3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated on Fri Feb 15 14:51:06 CET 2013 [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
335 useversionedarchname=''
341 initialinstalllocation=''
370 d_attribute_deprecated=''
371 d_attribute_format=''
372 d_attribute_malloc=''
373 d_attribute_nonnull=''
374 d_attribute_noreturn=''
376 d_attribute_unused=''
377 d_attribute_warn_unused_result=''
378 d_printf_format_null=''
381 d_builtin_choose_expr=''
384 d_c99_variadic_macros=''
431 endhostent_r_proto=''
437 endprotoent_r_proto=''
443 endservent_r_proto=''
496 gethostbyaddr_r_proto=''
498 gethostbyname_r_proto=''
500 gethostent_r_proto=''
513 getnetbyaddr_r_proto=''
515 getnetbyname_r_proto=''
529 d_getprotobyname_r=''
530 getprotobyname_r_proto=''
531 d_getprotobynumber_r=''
532 getprotobynumber_r_proto=''
534 getprotoent_r_proto=''
546 getservbyname_r_proto=''
548 getservbyport_r_proto=''
550 getservent_r_proto=''
577 d_libm_lib_version=''
580 d_localtime_r_needs_tzset=''
591 d_malloc_good_size=''
635 d_old_pthread_create_joinable=''
636 old_pthread_create_joinable=''
638 d_pthread_attr_setscope=''
677 sethostent_r_proto=''
694 setprotoent_r_proto=''
706 setservent_r_proto=''
730 d_ipv6_mreq_source=''
747 d_sprintf_returns_strlen=''
759 perl_static_inline=''
764 d_stdio_ptr_lval_nochange_cnt=''
765 d_stdio_ptr_lval_sets_cnt=''
910 d_gdbm_ndbm_h_uses_prototypes=''
911 d_gdbmndbm_h_uses_prototypes=''
913 d_ndbm_h_uses_prototypes=''
988 d_inc_version_list=''
990 inc_version_list_init=''
1009 ignore_versioned_solibs=''
1073 d_perl_otherlibdirs=''
1081 api_versionstring=''
1087 version_patchlevel_string=''
1091 d_nv_preserves_uv=''
1092 d_nv_zero_is_allbits_zero=''
1103 nv_overflows_integers_at=''
1104 nv_preserves_uv_bits=''
1176 installsitehtml1dir=''
1179 installsitehtml3dir=''
1186 installsiteman1dir=''
1189 installsiteman3dir=''
1194 installsitescript=''
1211 d_stdio_stream_array=''
1212 stdio_stream_array=''
1229 usekernprocpathname=''
1230 ccflags_uselargefiles=''
1231 ldflags_uselargefiles=''
1232 libswanted_uselargefiles=''
1241 usensgetexecutablepath=''
1254 installvendorarch=''
1261 installvendorhtml1dir=''
1263 vendorhtml1direxp=''
1264 installvendorhtml3dir=''
1266 vendorhtml3direxp=''
1272 installvendorman1dir=''
1275 installvendorman3dir=''
1282 installvendorscript=''
1295 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1298 : We must find out about Eunice early
1300 if test -f /etc/unixtovms; then
1301 eunicefix=/etc/unixtovms
1303 if test -f /etc/unixtovms.exe; then
1304 eunicefix=/etc/unixtovms.exe
1307 : Set executable suffix now -- needed before hints available
1308 if test -f "/libs/version.library"; then
1311 elif test -f "/system/gnu_library/bin/ar.pm"; then
1314 elif test -n "$DJGPP"; then
1317 elif test -d c:/. -o -n "$is_os2" ; then
1324 : Trailing extension. Override this in a hint file, if needed.
1325 : Extra object files, if any, needed on this platform.
1328 : Possible local include directories to search.
1329 : Set locincpth to "" in a hint file to defeat local include searches.
1330 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1331 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1333 : no include file wanted by default
1336 : Enable -DEBUGGING and -DDEBUGGING from the command line
1341 : change the next line if compiling for Xenix/286 on Xenix/386
1342 xlibpth='/usr/lib/386 /lib/386'
1343 : Possible local library directories to search.
1344 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1345 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1347 : general looking path for locating libraries
1348 glibpth="/lib /usr/lib $xlibpth"
1349 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1350 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1351 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1352 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1354 : Private path used by Configure to find libraries. Its value
1355 : is prepended to libpth. This variable takes care of special
1356 : machines, like the mips. Usually, it should be empty.
1359 : default library list
1361 : some systems want to use only the non-versioned libso:s
1362 ignore_versioned_solibs=''
1363 : set usethreads on the Configure command line to enable threads.
1364 usereentrant='undef'
1365 : full support for void wanted by default
1371 : set useposix=false in your hint file to disable the POSIX extension.
1373 : set useopcode=false in your hint file to disable the Opcode extension.
1376 ccflags_uselargefiles=''
1377 ldflags_uselargefiles=''
1378 libswanted_uselargefiles=''
1379 : set usemultiplicity on the Configure command line to enable multiplicity.
1380 : set usesocks on the Configure command line to enable socks.
1381 : List of libraries we want.
1382 : If anyone needs extra -lxxx, put those in a hint file.
1383 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1384 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1385 : We probably want to search /usr/shlib before most other libraries.
1386 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1387 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1388 glibpth="/usr/shlib $glibpth"
1389 : Do not use vfork unless overridden by a hint file.
1392 : Find the basic shell for Bourne shell scripts
1396 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1399 if test -f "$xxx"; then
1402 : Build up a list and do a single loop so we can 'break' out.
1403 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1404 for xxx in sh bash ksh pdksh ash; do
1406 try="$try ${p}/${xxx}"
1410 if test -f "$xxx"; then
1413 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1416 elif test -f "$xxx.exe"; then
1427 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1429 Usually it's in /bin/sh. How did you even get this far?
1430 Please contact me (Perl Maintainers) at perlbug@perl.org and
1431 we'll try to straighten this all out.
1437 : see if sh knows # comments
1438 if `$sh -c '#' >/dev/null 2>&1`; then
1442 test -f $xcat$_exe || xcat=/usr/bin/cat
1443 if test ! -f $xcat$_exe; then
1444 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1445 if test -f $p/cat$_exe; then
1450 if test ! -f $xcat$_exe; then
1451 echo "Can't find cat anywhere!"
1455 echo "#!$xcat" >sharp
1458 ./sharp > today 2>/dev/null
1459 if test -s today; then
1462 echo "#! $xcat" > sharp
1465 ./sharp > today 2>/dev/null
1466 if test -s today; then
1474 echo "Your $sh doesn't grok # comments--I will strip them later on."
1477 echo "exec grep -v '^[ ]*#'" >spitshell
1479 $eunicefix spitshell
1480 spitshell=`pwd`/spitshell
1482 echo "I presume that if # doesn't work, #! won't work either!"
1487 : figure out how to guarantee sh startup
1489 '') startsh=${sharpbang}${sh} ;;
1501 : echo "Yup, it does."
1503 echo "Hmm... '$startsh' does not guarantee sh startup..."
1504 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1508 : Save command line options in file UU/cmdline.opt for later use in
1509 : generating config.sh.
1510 cat > cmdline.opt <<EOSH
1511 : Configure command line arguments.
1520 cat >>cmdline.opt <<EOSH
1521 config_arg$argn='$arg'
1523 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1526 arg_exp=`cat cmdl.opt`
1527 args_exp="$args_exp$args_sep'$arg_exp'"
1528 argn=`expr $argn + 1`
1533 : produce awk script to parse command line options
1534 cat >options.awk <<'EOF'
1536 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1538 len = length(optstr);
1539 for (i = 1; i <= len; i++) {
1540 c = substr(optstr, i, 1);
1541 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1552 if (substr(str, 1, 1) != "-") {
1553 printf("'%s'\n", str);
1557 for (i = 2; i <= len; i++) {
1558 c = substr(str, i, 1);
1560 printf("-%s\n", substr(str, i));
1566 printf("'%s'\n", substr(str, i + 1));
1579 : process the command line options
1580 set X `for arg in "$@"; do echo "X$arg"; done |
1581 sed -e s/X// | awk -f options.awk`
1586 : set up default values
1596 rm -f optdef.sh posthint.sh
1597 cat >optdef.sh <<EOS
1603 while test $# -gt 0; do
1605 -d) shift; fastread=yes;;
1606 -e) shift; alldone=cont;;
1610 if test -r "$1"; then
1613 echo "$me: cannot read config file $1." >&2
1619 -h) shift; error=true;;
1620 -r) shift; reuseval=true;;
1621 -s) shift; silent=true; realsilent=true;;
1622 -E) shift; alldone=exit;;
1623 -K) shift; knowitall=true;;
1624 -O) shift; override=true;;
1625 -S) shift; silent=true; extractsh=true;;
1630 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1631 echo "$me: ignoring -D $1" >&2
1634 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1635 *) echo "$1='define'" >> optdef.sh;;
1642 *=) echo "$1" >> optdef.sh;;
1644 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1645 echo "$me: ignoring -U $1" >&2
1647 *) echo "$1='undef'" >> optdef.sh;;
1658 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1662 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1663 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1669 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1670 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1671 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1672 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1673 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1674 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1680 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1682 echo "$yyy=''" >> posthint.sh ;;
1687 echo "$yyy='$zzz'" >> posthint.sh ;;
1689 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1691 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1696 echo "$yyy=$zzz" >> posthint.sh ;;
1697 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1701 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1704 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1712 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1713 [-U symbol] [-U symbol=] [-A command:symbol...]
1714 -d : use defaults for all answers.
1715 -e : go on without questioning past the production of config.sh.
1716 -f : specify an alternate default configuration file.
1717 -h : print this help message and exit (with an error status).
1718 -r : reuse C symbols value if possible (skips costly nm extraction).
1719 -s : silent mode, only echoes questions and essential information.
1720 -D : define symbol to have some value:
1721 -D symbol symbol gets the value 'define'
1722 -D symbol=value symbol gets the value 'value'
1723 common used examples (see INSTALL for more info):
1724 -Duse64bitint use 64bit integers
1725 -Duse64bitall use 64bit integers and pointers
1726 -Dusethreads use thread support
1727 -Dinc_version_list=none do not include older perl trees in @INC
1728 -DEBUGGING=none DEBUGGING options
1729 -Dcc=gcc choose your compiler
1730 -Dprefix=/opt/perl5 choose your destination
1731 -E : stop at the end of questions, after having produced config.sh.
1732 -K : do not use unless you know what you are doing.
1733 -O : let -D and -U override definitions from loaded configuration file.
1734 -S : perform variable substitutions on all .SH files (can mix with -f)
1735 -U : undefine symbol:
1736 -U symbol symbol gets the value 'undef'
1737 -U symbol= symbol gets completely empty
1739 -A : manipulate symbol after the platform specific hints have been applied:
1740 -A append:symbol=value append value to symbol
1741 -A symbol=value like append:, but with a separating space
1742 -A define:symbol=value define symbol to have value
1743 -A clear:symbol define symbol to be ''
1744 -A define:symbol define symbol to be 'define'
1745 -A eval:symbol=value define symbol to be eval of value
1746 -A prepend:symbol=value prepend value to symbol
1747 -A undef:symbol define symbol to be 'undef'
1748 -A undef:symbol= define symbol to be ''
1749 e.g.: -A prepend:libswanted='cl pthread '
1750 -A ccflags=-DSOME_MACRO
1751 -V : print version number and exit (with a zero status).
1758 case "$fastread$alldone" in
1761 case "$extractsh" in
1764 if test ! -t 0; then
1765 echo "Say 'sh Configure', not 'sh <Configure'"
1775 true) exec 1>/dev/null;;
1778 : run the defines and the undefines, if any, but leave the file out there...
1781 : create the posthint manipulation script and leave the file out there...
1786 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1787 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1788 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1789 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1790 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1793 : Some greps do not return status, grrr.
1794 echo "grimblepritz" >grimble
1795 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1797 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1803 : the following should work in any shell
1807 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1808 cat >contains <<'EOSS'
1809 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1814 : Find the path to the source tree
1817 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1821 *) src=`cd ../$src && pwd` ;;
1834 if test -f $rsrc/Configure && \
1835 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1837 : found it, so we are ok.
1840 for src in . .. ../.. ../../.. ../../../..; do
1841 if test -f ../$src/Configure && \
1842 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1853 Sorry, I can't seem to locate the source dir for $package. Please start
1854 Configure with an explicit path -- i.e. /some/path/Configure.
1862 echo "Sources for $package found in \"$src\"." >&4
1866 : script used to extract .SH files with variable substitutions
1867 cat >extract <<'EOS'
1869 echo "Doing variable substitutions on .SH files..."
1870 if test -f MANIFEST; then
1871 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1873 echo "(Looking for .SH files under the source directory.)"
1874 set x `(cd "$src"; find . -name "*.SH" -print)`
1878 0) set x `(cd "$src"; echo *.SH)`; shift;;
1880 if test ! -f "$src/$1"; then
1886 while test $name; do
1887 if test ! -d "$name"; then
1888 create="$name $create";
1889 name=`echo $name | sed -e "s|^[^/]*$||"`;
1890 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1895 for file in $create; do
1904 dir=`expr X$file : 'X\(.*\)/'`
1905 file=`expr X$file : 'X.*/\(.*\)'`
1906 (cd "$dir" && . ./$file)
1916 dir=`expr X$file : 'X\(.*\)/'`
1917 file=`expr X$file : 'X.*/\(.*\)'`
1918 (set x $dir; shift; eval $mkdir_p)
1919 sh <"$src/$dir/$file"
1928 if test -f "$src/config_h.SH"; then
1929 if test ! -f config.h; then
1930 : oops, they left it out of MANIFEST, probably, so do it anyway.
1931 . "$src/config_h.SH"
1936 : extract files and exit if asked to do so
1937 case "$extractsh" in
1939 case "$realsilent" in
1943 case "$config_sh" in
1944 '') config_sh='config.sh';;
1947 echo "Fetching answers from $config_sh..."
1950 test "$override" && . ./optdef.sh
1954 echo "Extraction done."
1959 : Eunice requires " " instead of "", can you believe it
1962 echo "Beginning of configuration questions for $package."
1964 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1966 : first determine how to suppress newline on echo command
1968 echo "Checking echo to see how to suppress newlines..."
1969 (echo "hi there\c" ; echo " ") >.echotmp
1970 if $contains c .echotmp >/dev/null 2>&1 ; then
1981 echo $n "The star should be here-->$c"
1985 : Now test for existence of everything in MANIFEST
1987 if test -f "$rsrc/MANIFEST"; then
1988 echo "First let's make sure your kit is complete. Checking..." >&4
1989 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1990 (split -l 50 2>/dev/null || split -50)
1993 for filelist in x??; do
1994 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1995 >/dev/null 2>>"$tmppwd/missing")
1997 if test -s missing; then
2001 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2003 You have the option of continuing the configuration process, despite the
2004 distinct possibility that your kit is damaged, by typing 'y'es. If you
2005 do, don't blame me if something goes wrong. I advise you to type 'n'o
2006 and contact the author (perlbug@perl.org).
2009 echo $n "Continue? [n] $c" >&4
2013 echo "Continuing..." >&4
2017 echo "ABORTING..." >&4
2022 echo "Looks good..."
2025 echo "There is no MANIFEST file. I hope your kit is complete !"
2029 : Find the appropriate value for a newline for tr
2031 if test -n "$DJGPP"; then
2034 if test X"$trnl" = X; then
2035 case "`echo foo|tr '\n' x 2>/dev/null`" in
2039 if test X"$trnl" = X; then
2040 case "`echo foo|tr '\012' x 2>/dev/null`" in
2041 foox) trnl='\012' ;;
2044 if test X"$trnl" = X; then
2045 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2046 fooxy) trnl='\n\r' ;;
2049 if test X"$trnl" = X; then
2052 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2058 : compute the number of columns on the terminal for proper question formatting
2063 : set up the echo used in my read
2064 myecho="case \"\$xxxm\" in
2065 '') echo $n \"\$rp $c\" >&4;;
2067 '') echo $n \"[\$xxxm] $c\";;
2069 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2071 echo $n \"[\$xxxm] $c\" >&4
2073 echo $n \"\$rp [\$xxxm] $c\" >&4
2079 : now set up to do reads with possible shell escape and default assignment
2085 case "\$fastread" in
2086 yes) case "\$dflt" in
2089 case "\$silent-\$rp" in
2094 *) case "\$silent" in
2095 true) case "\$rp" in
2100 while expr "X\$ans" : "X!" >/dev/null; do
2104 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2112 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2121 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2126 echo "(OK, I'll run with -d after this question.)" >&4
2129 echo "*** Sorry, \$1 not supported yet." >&4
2139 echo "*** Substitution done -- please confirm."
2141 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2146 echo "*** Error -- try again."
2153 case "\$ans\$xxxm\$nostick" in
2165 : create .config dir to save info across Configure sessions
2166 test -d ../.config || mkdir ../.config
2167 cat >../.config/README <<EOF
2168 This directory created by Configure to save information that should
2169 persist across sessions for $package.
2171 You may safely delete it if you wish.
2174 : See if we are using a devel version and want that
2175 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2178 usedevel="$define" ;;
2179 *) case "$xversion" in
2182 *** WHOA THERE!!! ***
2184 This is an UNSTABLE DEVELOPMENT release.
2185 The version of this $package distribution is $xversion, that is, odd,
2186 (as opposed to even) and that signifies a development release.
2187 If you want a maintenance release, you want an even-numbered version.
2189 Do ***NOT*** install this into production use.
2190 Data corruption and crashes are possible.
2192 It is most seriously suggested that you do not continue any further
2193 unless you want to help in developing and debugging Perl.
2195 If you *still* want to build perl, you can answer 'y' now,
2196 or pass -Dusedevel to Configure.
2199 rp='Do you really want to continue?'
2203 [yY]) echo >&4 "Okay, continuing."
2204 usedevel="$define" ;;
2205 *) echo >&4 "Okay, bye."
2216 case "$versiononly" in
2217 '') versiononly="$define" ;;
2219 case "$installusrbinperl" in
2220 '') installusrbinperl="$undef" ;;
2225 : general instructions
2228 user=`(logname) 2>/dev/null`
2230 '') user=`whoami 2>&1`;;
2232 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2235 rp='Would you like to see the instructions?'
2246 This installation shell script will examine your system and ask you questions
2247 to determine how the perl5 package should be installed. If you get
2248 stuck on a question, you may use a ! shell escape to start a subshell or
2249 execute a command. Many of the questions will have default answers in square
2250 brackets; typing carriage return will give you the default.
2252 On some of the questions which ask for file or directory names you are allowed
2253 to use the ~name construct to specify the login directory belonging to "name",
2254 even if you don't have a shell which knows about that. Questions where this is
2255 allowed will be marked "(~name ok)".
2259 dflt='Type carriage return to continue'
2263 The prompter used in this script allows you to use shell variables and
2264 backticks in your answers. You may use $1, $2, etc... to refer to the words
2265 in the default answer, as if the default line was a set of arguments given to a
2266 script shell. This means you may also use $* to repeat the whole default line,
2267 so you do not have to re-type everything to add something to the default.
2269 Every time there is a substitution, you will have to confirm. If there is an
2270 error (e.g. an unmatched backtick), the default answer will remain unchanged
2271 and you will be prompted again.
2273 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2274 the questions and use the computed defaults (or the previous answers if there
2275 was already a config.sh file). Type 'Configure -h' for a list of options.
2276 You may also start interactively and then answer '& -d' at any prompt to turn
2277 on the non-interactive behaviour for the remainder of the execution.
2283 Much effort has been expended to ensure that this shell script will run on any
2284 Unix system. If despite that it blows up on yours, your best bet is to edit
2285 Configure and run it again. If you can't run Configure for some reason,
2286 you'll have to generate a config.sh file by hand. Whatever problems you
2287 have, let me (perlbug@perl.org) know how I blew it.
2289 This installation script affects things in two ways:
2291 1) it may do direct variable substitutions on some of the files included
2293 2) it builds a config.h file for inclusion in C programs. You may edit
2294 any of these files as the need arises after running this script.
2296 If you make a mistake on a question, there is no easy way to back up to it
2297 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2298 files. Configure will offer to let you do this before it runs the SH files.
2301 dflt='Type carriage return to continue'
2303 case "$firsttime" in
2304 true) echo $user >>../.config/instruct;;
2308 : find out where common programs are
2310 echo "Locating common programs..." >&4
2323 if test -d \$dir/\$thing; then
2329 for thisthing in \$dir/\$thing; do
2330 : just loop through to pick last item
2332 if test -f \$thisthing; then
2335 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2338 elif test -f \$dir/\$thing.exe; then
2339 if test -n "$DJGPP"; then
2340 echo \$dir/\$thing.exe
2341 elif test "$eunicefix" != ":"; then
2342 : on Eunice apparently
2395 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2396 pth="$pth /lib /usr/lib"
2397 for file in $loclist; do
2401 if test -f "$xxx"; then
2404 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2405 xxx=`./loc $file $file $pth`
2408 '') xxx=`./loc $file $file $pth`;;
2409 *) xxx=`./loc $xxx $xxx $pth`;;
2411 eval $file=$xxx$_exe
2415 echo $file is in $xxx.
2418 echo $file is in $xxx.
2421 echo "I don't know where '$file' is, and my life depends on it." >&4
2422 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2428 echo "Don't worry if any of the following aren't found..."
2430 for file in $trylist; do
2434 if test -f "$xxx"; then
2437 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2438 xxx=`./loc $file $file $pth`
2441 '') xxx=`./loc $file $file $pth`;;
2442 *) xxx=`./loc $xxx $xxx $pth`;;
2444 eval $file=$xxx$_exe
2448 echo $file is in $xxx.
2451 echo $file is in $xxx.
2454 echo "I don't see $file out there, $say."
2461 echo "Substituting grep for egrep."
2468 *) if $less -R </dev/null >/dev/null; then
2469 echo "Substituting less -R for less."
2477 echo "Substituting cp for ln."
2486 echo "I can't find make or gmake, and my life depends on it." >&4
2487 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2495 *) # We can't have osname yet.
2496 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2497 # Assume that gmake, if found, is definitely GNU make
2498 # and prefer it over the system make.
2499 echo "Substituting gmake for make."
2507 echo "Hopefully test is built into your sh."
2510 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2511 echo "Using the test built into your sh."
2519 echo "Hopefully echo is built into your sh."
2524 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2525 $echo $n "hi there$c" >foo1
2526 echo $n "hi there$c" >foo2
2527 if cmp foo1 foo2 >/dev/null 2>&1; then
2528 echo "They are compatible. In fact, they may be identical."
2535 They are not compatible! You are probably running ksh on a non-USG system.
2536 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2537 have echo built in and we may have to run some Bourne shell scripts. That
2538 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2541 $echo $n "The star should be here-->$c"
2548 # This question was auctioned at YAPC::Europe-2007 in Vienna
2549 # I never promised you could answer it. I only auctioned the question.
2551 The following message is sponsored by
2553 Dresden.pm<--The stars should be here.
2555 Dear Perl user, system administrator or package
2556 maintainer, the Perl community sends greetings to
2557 you. Do you (emblematical) greet back [Y/n]? n
2561 : Check what type of C compiler we use
2565 cat <<'EOSC' >>trygcc
2570 int main(int argc, char *argv[]) {
2574 if $cc -o try $ccflags $ldflags try.c; then
2577 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2583 # Skip this test because it gives a false match on output like:
2584 # ./trygcc: line 23: cc: command not found
2585 # case "`$cc -v -c try.c 2>&1`" in
2586 # *gcc*) trygcc=no ;;
2588 if $test X"$trygcc" = Xyes; then
2589 if gcc -o try -c try.c; then
2591 echo "You seem to have a working gcc, though." >&4
2592 # Switching compilers may undo the work of hints files.
2593 # The most common problem is -D_REENTRANT for threads.
2594 # This heuristic catches that case, but gets false positives
2595 # if -Dusethreads was not actually specified. Better to
2596 # bail out here with a useful message than fail
2597 # mysteriously later. Should we perhaps just try to
2598 # re-invoke Configure -Dcc=gcc config_args ?
2599 if $test -f usethreads.cbu; then
2602 *** However, any setting of the C compiler flags (e.g. for thread support)
2603 *** will be lost. It may be necessary for you to restart Configure and
2604 *** add -Dcc=gcc to your Configure command line.
2607 rp="Would you like to go ahead and try gcc anyway?"
2610 rp="Would you like to use it?"
2613 if $test -f myread; then
2616 if $test -f UU/myread; then
2619 echo "Cannot find myread, sorry. Aborting." >&2
2624 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2637 cat <<'EOSC' >>checkcc
2642 int main(int argc, char *argv[]) {
2646 if $cc -o try $ccflags $ldflags try.c; then
2649 if $test X"$despair" = Xyes; then
2650 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2653 You need to find a working C compiler.
2654 Either (purchase and) install the C compiler supplied by your OS vendor,
2655 or for a free C compiler try http://gcc.gnu.org/
2656 I cannot continue any further, aborting.
2665 : determine whether symbolic links are supported
2668 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2669 echo "Symbolic links are supported." >&4
2672 echo "Symbolic links are NOT supported." >&4
2677 : determine whether symbolic links are supported
2681 echo "Checking how to test for symbolic links..." >&4
2683 if $test "X$issymlink" = X; then
2685 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2686 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2688 if test $? = 0; then
2691 echo "Your builtin 'test -h' may be broken." >&4
2694 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2697 if test -f "$p/$test"; then
2706 echo "Trying external '$test -h'." >&4
2707 issymlink="$test -h"
2708 if $test ! -h sym >/dev/null 2>&1; then
2709 echo "External '$test -h' is broken, too." >&4
2717 if $test "X$issymlink" = X; then
2718 if $test -L sym 2>/dev/null; then
2719 issymlink="$test -L"
2720 echo "The builtin '$test -L' worked." >&4
2723 if $test "X$issymlink" != X; then
2724 echo "You can test for symbolic links with '$issymlink'." >&4
2726 echo "I do not know how you can test for symbolic links." >&4
2730 *) echo "No symbolic links, so not testing for their testing..." >&4
2735 : Make symlinks util
2736 case "$mksymlinks" in
2739 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2742 *) case "$lns:$issymlink" in
2743 *"ln"*" -s:"*"test -"?)
2744 echo "Creating the symbolic links..." >&4
2745 echo "(First creating the subdirectories...)" >&4
2747 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2749 test -z "$directory" && break
2753 if test ! -d t/base; then
2754 echo "Failed to create the subdirectories. Aborting." >&4
2757 echo "(Then creating the symlinks...)" >&4
2758 awk '{print $1}' $src/MANIFEST | while true; do
2760 test -z "$filename" && break
2761 if test -f $filename; then
2762 if $issymlink $filename; then
2766 if test -f $filename; then
2767 echo "$filename already exists, not symlinking."
2769 ln -s $src/$filename $filename
2773 if test ! -f t/base/lex.t; then
2774 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2779 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2787 : Check for Cross-Compilation
2788 case "$usecrosscompile" in
2790 $echo "Cross-compiling..."
2793 *-*-gcc) # A cross-compiling gcc, probably.
2794 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2796 # leave out ld, choosing it is more complex
2798 ranlib=$targetarch-ranlib
2799 $echo 'extern int foo;' > try.c
2800 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2802 if $test $# -gt 0; then
2804 incpth="`$echo $incpth|$sed 's/^ //'`"
2805 echo "Guessing incpth '$incpth'." >&4
2807 j="`$echo $i|$sed 's,/include$,/lib,'`"
2808 if $test -d $j; then
2812 libpth="`$echo $libpth|$sed 's/^ //'`"
2813 echo "Guessing libpth '$libpth'." >&4
2818 case "$targetarch" in
2819 '') echo "Targetarch not defined." >&4; croak=y ;;
2820 *) echo "Using targetarch $targetarch." >&4 ;;
2823 '') echo "Incpth not defined." >&4; croak=y ;;
2824 *) echo "Using incpth '$incpth'." >&4 ;;
2827 '') echo "Libpth not defined." >&4; croak=y ;;
2828 *) echo "Using libpth '$libpth'." >&4 ;;
2831 '') for i in $incpth; do
2832 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2834 echo "Guessing usrinc $usrinc." >&4
2839 '') echo "Usrinc not defined." >&4; croak=y ;;
2842 *) echo "Using usrinc $usrinc." >&4 ;;
2844 case "$targethost" in
2845 '') echo "Targethost not defined." >&4; croak=y ;;
2846 *) echo "Using targethost $targethost." >&4
2851 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2854 /*) run=$src/Cross/run
2855 targetmkdir=$src/Cross/mkdir
2857 from=$src/Cross/from
2859 *) pwd=`$test -f ../Configure & cd ..; pwd`
2861 targetmkdir=$pwd/Cross/mkdir
2863 from=$pwd/Cross/from
2866 case "$targetrun" in
2867 '') targetrun=ssh ;;
2872 case "$targetfrom" in
2873 '') targetfrom=scp ;;
2877 from=$from-$targetfrom
2878 case "$targetdir" in
2880 echo "Guessing targetdir $targetdir." >&4
2883 case "$targetuser" in
2885 echo "Guessing targetuser $targetuser." >&4
2888 case "$targetfrom" in
2892 case "$targetrun" in
2904 '') cwd=$targetdir ;;
2908 if $test ! -f \$exe.xok; then
2912 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2915 *) echo "Unknown targetrun '$targetrun'" >&4
2919 case "$targetmkdir" in
2921 cat >$targetmkdir <<EOF
2923 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2925 $chmod a+rx $targetmkdir
2927 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2939 $targetmkdir \`dirname \$f\`
2940 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2943 $targetmkdir $targetdir/\`dirname \$f\`
2944 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2957 $mkdir -p $targetdir/\`dirname \$f\`
2958 $cp \$f $targetdir/\$f || exit 1
2961 $targetmkdir $targetdir/\`dirname \$f\`
2962 $cp \$f $targetdir/\$f || exit 1
2969 *) echo "Unknown targetto '$targetto'" >&4
2973 case "$targetfrom" in
2980 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2985 cp) cat >$from <<EOF
2990 cp $targetdir/\$f . || exit 1
2995 *) echo "Unknown targetfrom '$targetfrom'" >&4
2999 if $test ! -f $run; then
3000 echo "Target 'run' script '$run' not found." >&4
3004 if $test ! -f $to; then
3005 echo "Target 'to' script '$to' not found." >&4
3009 if $test ! -f $from; then
3010 echo "Target 'from' script '$from' not found." >&4
3014 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3018 Using '$run' for remote execution,
3019 and '$from' and '$to'
3020 for remote file transfer.
3026 usecrosscompile='undef'
3031 : see whether [:lower:] and [:upper:] are supported character classes
3033 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3035 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3039 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3040 # (0xd9 and 0xe2), therefore that is a nice testing point.
3041 if test "X$up" = X -o "X$low" = X; then
3042 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3048 if test "X$up" = X -o "X$low" = X; then
3049 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3055 if test "X$up" = X -o "X$low" = X; then
3056 case "`echo RS | od -x 2>/dev/null`" in
3058 echo "Hey, this might be EBCDIC." >&4
3059 if test "X$up" = X -o "X$low" = X; then
3060 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3061 rs) up='[A-IJ-RS-Z]'
3066 if test "X$up" = X -o "X$low" = X; then
3067 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3077 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3079 echo "Using $up and $low to convert case." >&4
3082 echo "I don't know how to translate letters from upper to lower case." >&4
3083 echo "Your tr is not acting any way I know of." >&4
3087 : set up the translation script tr, must be called with ./tr of course
3091 '[A-Z][a-z]') exec $tr '$up' '$low';;
3092 '[a-z][A-Z]') exec $tr '$low' '$up';;
3099 : Try to determine whether config.sh was made on this system
3100 case "$config_sh" in
3102 myuname=`$uname -a 2>/dev/null`
3103 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3104 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3105 # because the A-Z/a-z are not consecutive.
3106 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3107 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3108 newmyuname="$myuname"
3110 case "$knowitall" in
3112 if test -f ../config.sh; then
3113 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3114 eval "`grep myuname= ../config.sh`"
3116 if test "X$myuname" = "X$newmyuname"; then
3124 : Get old answers from old config file if Configure was run on the
3125 : same system, otherwise use the hints.
3128 if test -f config.sh; then
3130 rp="I see a config.sh file. Shall I use it to set the defaults?"
3133 n*|N*) echo "OK, I'll ignore it."
3134 mv config.sh config.sh.old
3135 myuname="$newmyuname"
3137 *) echo "Fetching default answers from your old config.sh file..." >&4
3145 : Older versions did not always set $sh. Catch re-use of such
3155 if test ! -f config.sh; then
3158 First time through, eh? I have some defaults handy for some systems
3159 that need some extra help getting the Configure answers right:
3162 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3164 : Half the following guesses are probably wrong... If you have better
3165 : tests or hints, please send them to perlbug@perl.org
3166 : The metaconfig authors would also appreciate a copy...
3167 $test -f /irix && osname=irix
3168 $test -f /xenix && osname=sco_xenix
3169 $test -f /dynix && osname=dynix
3170 $test -f /dnix && osname=dnix
3171 $test -f /lynx.os && osname=lynxos
3172 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3173 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3174 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3175 $test -f /bin/mips && /bin/mips && osname=mips
3176 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3177 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3178 $test -d /usr/apollo/bin && osname=apollo
3179 $test -f /etc/saf/_sactab && osname=svr4
3180 $test -d /usr/include/minix && osname=minix
3181 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3182 if $test -d /MachTen -o -d /MachTen_Folder; then
3184 if $test -x /sbin/version; then
3185 osvers=`/sbin/version | $awk '{print $2}' |
3186 $sed -e 's/[A-Za-z]$//'`
3187 elif $test -x /usr/etc/version; then
3188 osvers=`/usr/etc/version | $awk '{print $2}' |
3189 $sed -e 's/[A-Za-z]$//'`
3195 $test -f /sys/posix.dll &&
3196 $test -f /usr/bin/what &&
3197 set X `/usr/bin/what /sys/posix.dll` &&
3198 $test "$3" = UWIN &&
3202 if $test -f $uname; then
3210 umips) osname=umips ;;
3213 [23]100) osname=mips ;;
3214 next*) osname=next ;;
3216 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3217 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3220 elif $test -f /etc/kconfig; then
3222 if test "$lns" = "$ln -s"; then
3224 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3226 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3233 if test -n "$DJGPP"; then
3242 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3244 # oslevel can fail with:
3245 # oslevel: Unable to acquire lock.
3246 *not\ found) osvers="$4"."$3" ;;
3247 '<3240'|'<>3240') osvers=3.2.0 ;;
3248 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3249 '=3250'|'>3250') osvers=3.2.5 ;;
3253 bsd386) osname=bsd386
3256 cygwin*) osname=cygwin
3259 *dc.osx) osname=dcosx
3265 domainos) osname=apollo
3271 dragonfly) osname=dragonfly
3274 dynixptx*) osname=dynixptx
3275 osvers=`echo "$4"|sed 's/^v//'`
3277 freebsd) osname=freebsd
3279 genix) osname=genix ;;
3283 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3299 netbsd*) osname=netbsd
3302 news-os) osvers="$3"
3304 4*) osname=newsos4 ;;
3308 next*) osname=next ;;
3309 nonstop-ux) osname=nonstopux ;;
3310 openbsd) osname=openbsd
3316 POSIX-BC | posix-bc ) osname=posix-bc
3319 powerux | power_ux | powermax_os | powermaxos | \
3320 powerunix | power_unix) osname=powerux
3326 solaris) osname=solaris
3328 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3335 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3339 titanos) osname=titanos
3348 ultrix) osname=ultrix
3351 osf1|mls+) case "$5" in
3354 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3357 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3360 hp*) osname=hp_osf1 ;;
3361 mips) osname=mips_osf1 ;;
3364 # UnixWare 7.1.2 is known as Open UNIX 8
3365 openunix|unixware) osname=svr5
3373 $2) case "$osname" in
3377 : svr4.x or possibly later
3387 if test -f /stand/boot ; then
3388 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3389 if test -n "$INITPROG" -a -f "$INITPROG"; then
3390 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3391 if test -n "$isesix"; then
3399 *) if test -f /etc/systemid; then
3401 set `echo $3 | $sed 's/\./ /g'` $4
3402 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3404 elif $test -f $src/hints/sco_$1_$2.sh; then
3406 elif $test -f $src/hints/sco_$1.sh; then
3411 '') : Still unknown. Probably a generic Sys V.
3420 *) case "$osname" in
3421 '') : Still unknown. Probably a generic BSD.
3429 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3430 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3431 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3434 $rm -f UU/kernel.what
3435 elif test -d c:/. -o -n "$is_os2" ; then
3442 case "$targetarch" in
3445 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3450 : Now look for a hint file osname_osvers, unless one has been
3451 : specified already.
3454 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3455 : Also try without trailing minor version numbers.
3456 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3457 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3458 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3459 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3462 *) case "$osvers" in
3465 *) if $test -f $src/hints/$file.sh ; then
3467 elif $test -f $src/hints/$xfile.sh ; then
3469 elif $test -f $src/hints/$xxfile.sh ; then
3471 elif $test -f $src/hints/$xxxfile.sh ; then
3473 elif $test -f $src/hints/$xxxxfile.sh ; then
3475 elif $test -f "$src/hints/${osname}.sh" ; then
3484 if $test -f Policy.sh ; then
3487 none) dflt="Policy" ;;
3488 *) dflt="Policy $dflt" ;;
3493 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3497 if $test -f Policy.sh ; then
3500 There's also a Policy hint file available, which should make the
3501 site-specific (policy) questions easier to answer.
3508 You may give one or more space-separated answers, or "none" if appropriate.
3509 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3510 previous run of Configure, you may specify it as well as or instead of
3511 OS-specific hints. If hints are provided for your OS, you should use them:
3512 although Perl can probably be built without hints on many platforms, using
3513 hints often improve performance and may enable features that Configure can't
3514 set up on its own. If there are no hints that match your OS, specify "none";
3515 DO NOT give a wrong version or a wrong OS.
3519 rp="Which of these apply, if any?"
3522 for file in $tans; do
3523 if $test X$file = XPolicy -a -f Policy.sh; then
3525 $cat Policy.sh >> UU/config.sh
3526 elif $test -f $src/hints/$file.sh; then
3527 . $src/hints/$file.sh
3528 $cat $src/hints/$file.sh >> UU/config.sh
3529 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3532 : Give one chance to correct a possible typo.
3533 echo "$file.sh does not exist"
3535 rp="hint to use instead?"
3537 for file in $ans; do
3538 if $test -f "$src/hints/$file.sh"; then
3539 . $src/hints/$file.sh
3540 $cat $src/hints/$file.sh >> UU/config.sh
3541 elif $test X$ans = X -o X$ans = Xnone ; then
3544 echo "$file.sh does not exist -- ignored."
3551 : Remember our hint file for later.
3552 if $test -f "$src/hints/$file.sh" ; then
3562 echo "Fetching default answers from $config_sh..." >&4
3566 cp $config_sh config.sh 2>/dev/null
3576 test "$override" && . ./optdef.sh
3578 : Restore computed paths
3579 for file in $loclist $trylist; do
3580 eval $file="\$_$file"
3585 Configure uses the operating system name and version to set some defaults.
3586 The default value is probably right if the name rings a bell. Otherwise,
3587 since spelling matters for me, either accept the default or answer "none"
3594 ''|' '|none) dflt=none ;;
3595 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3598 *) dflt="$osname" ;;
3600 rp="Operating system name?"
3604 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3610 ''|' '|none) dflt=none ;;
3611 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3612 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3614 ''|' ') dflt=none ;;
3619 *) dflt="$osvers" ;;
3621 rp="Operating system version?"
3631 : who configured the system
3632 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3635 cf_by=`(logname) 2>/dev/null`
3638 cf_by=`(whoami) 2>/dev/null`
3640 "") cf_by=unknown ;;
3645 : decide how portable to be. Allow command line overrides.
3646 case "$d_portable" in
3648 *) d_portable="$define" ;;
3651 : set up shell script to do ~ expansion
3657 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3660 if $test -f /bin/csh; then
3661 /bin/csh -f -c "glob \$1"
3666 name=\`$expr x\$1 : '..\([^/]*\)'\`
3667 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3668 if $test ! -d "\$dir"; then
3670 echo "\$me: can't locate home directory for: \$name" >&2
3675 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3691 : now set up to get a file name
3695 cat <<'EOSC' >>getfile
3711 : getfile will accept an answer from the comma-separated list
3712 : enclosed in parentheses even if it does not meet other criteria.
3713 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3714 fn=`echo $fn | sed 's/(.*)//'`
3720 loc_file=`expr $fn : '.*:\(.*\)'`
3721 fn=`expr $fn : '\(.*\):.*'`
3729 */*) fullpath=true;;
3738 *e*) exp_file=true;;
3741 *p*) nopath_ok=true;;
3746 *d*) type='Directory';;
3747 *l*) type='Locate';;
3752 Locate) what='File';;
3757 case "$d_portable" in
3765 while test "$type"; do
3770 true) rp="$rp (~name ok)";;
3773 if test -f UU/getfile.ok && \
3774 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3793 value=`UU/filexp $ans`
3796 if test "$ans" != "$value"; then
3797 echo "(That expands to $value on this system.)"
3811 /*) value="$ansexp" ;;
3812 [a-zA-Z]:/*) value="$ansexp" ;;
3817 echo "I shall only accept a full path name, as in /bin/ls." >&4
3818 echo "Use a ! shell escape if you wish to check pathnames." >&4
3821 echo "Please give a full path name, starting with slash." >&4
3824 echo "Note that using ~name is ok provided it expands well." >&4
3837 for fp in $gfpth; do
3838 if test "X$fp" = X.; then
3843 if test -f "$pf"; then
3845 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3847 echo "($value is not a plain file, but that's ok.)"
3850 if test X"$type" = X; then
3857 for fp in $gfpth; do
3858 if test "X$fp" = X.; then
3863 direxp="$fp/$ansexp"
3865 if test -d "$direxp"; then
3873 if test -d "$ansexp"; then
3874 echo "(Looking for $loc_file in directory $value.)"
3875 value="$value/$loc_file"
3876 ansexp="$ansexp/$loc_file"
3878 if test -f "$ansexp"; then
3881 case "$nopath_ok" in
3882 true) case "$value" in
3884 *) echo "Assuming $value will be in people's path."
3900 if test "$fastread" = yes; then
3905 rp="$what $value doesn't exist. Use that name anyway?"
3924 test "X$gfpthkeep" != Xy && gfpth=""
3927 : determine root of directory hierarchy where package will be installed.
3930 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3933 dflt=`echo "$prefix" | sed 's/.$//'`
3941 By default, $package will be installed in $dflt/bin, manual pages
3942 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3943 installation directories. Typically this is something like /usr/local.
3944 If you wish to have binaries under /usr/bin but other parts of the
3945 installation under /usr/local, that's ok: you will be prompted
3946 separately for each of the installation directories, the prefix being
3947 only used to set the defaults.
3951 rp='Installation prefix to use?'
3959 *) oldprefix="$prefix";;
3966 : allow them to override the AFS root
3969 *) afsroot=$afsroot ;;
3975 $define|true) afs=true ;;
3976 $undef|false) afs=false ;;
3977 *) if $test -d $afsroot; then
3985 echo "AFS may be running... I'll be extra cautious then..." >&4
3987 echo "AFS does not seem to be running..." >&4
3990 : determine installation prefix for where package is to be installed.
3994 Since you are running AFS, I need to distinguish the directory in which
3995 files will reside from the directory in which they are installed (and from
3996 which they are presumably copied to the former directory by occult means).
3999 case "$installprefix" in
4000 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4001 *) dflt="$installprefix";;
4006 In some special cases, particularly when building $package for distribution,
4007 it is convenient to distinguish the directory in which files should be
4008 installed from the directory ($prefix) in which they will
4009 eventually reside. For most users, these two directories are the same.
4012 case "$installprefix" in
4014 *) dflt=$installprefix;;
4018 rp='What installation prefix should I use for installing files?'
4020 installprefix="$ans"
4021 installprefixexp="$ansexp"
4023 : Perform the prefixexp/installprefixexp correction if necessary
4024 cat <<EOS >installprefix
4027 cat <<'EOSC' >>installprefix
4028 : Change installation prefix, if necessary.
4029 if $test X"$prefix" != X"$installprefix"; then
4030 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4032 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4035 chmod +x installprefix
4036 $eunicefix installprefix
4038 : Set variables such as privlib and privlibexp from the output of ./getfile
4039 : performing the prefixexp/installprefixexp correction if necessary.
4040 cat <<EOS >setprefixvar
4043 cat <<'EOSC' >>setprefixvar
4044 eval "${prefixvar}=\"\$ans\""
4045 eval "${prefixvar}exp=\"\$ansexp\""
4048 chmod +x setprefixvar
4049 $eunicefix setprefixvar
4051 : set up the script used to warn in case of inconsistency
4060 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4062 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4063 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4068 echo "*** WHOA THERE!!! ***" >&4
4069 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4072 rp=" Keep the $hint value?"
4075 y) td=$was; tu=$was;;
4079 : function used to set '$1' to '$val'
4080 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4082 $define$undef) . ./whoa; eval "$var=\$td";;
4083 $undef$define) . ./whoa; eval "$var=\$tu";;
4084 *) eval "$var=$val";;
4087 : get the patchlevel
4089 echo "Getting the current patchlevel..." >&4
4090 if $test -r $rsrc/patchlevel.h;then
4091 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4092 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4093 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4094 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4095 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4096 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4097 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4106 $echo "(You do not have patchlevel.h. Eek.)"
4108 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4109 version_patchlevel_string="version $patchlevel subversion $subversion"
4110 case "$perl_patchlevel" in
4112 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4113 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4117 $echo "(You have $package $version_patchlevel_string.)"
4121 : XXX Should be a Configure test for double-dots in filenames.
4122 version=`echo $revision $patchlevel $subversion | \
4123 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4124 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4125 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4128 version=`echo $revision $patchlevel $subversion | \
4129 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4130 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4131 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4134 : Special case the 5.005_xx maintenance series, which used 5.005
4135 : without any subversion label as a subdirectory in $sitelib
4136 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4137 api_versionstring='5.005'
4140 : Do we want threads support and if so, what type
4141 case "$usethreads" in
4142 $define|true|[yY]*) dflt='y';;
4143 *) # Catch case where user specified ithreads or 5005threads but
4144 # forgot -Dusethreads (A.D. 4/2002)
4145 case "$useithreads$use5005threads" in
4146 *$define*) dflt='y';;
4153 Perl can be built to take advantage of threads on some systems.
4154 To do so, Configure can be run with -Dusethreads.
4156 Note that Perl built with threading support runs slightly slower
4157 and uses more memory than plain Perl. The current implementation
4158 is believed to be stable, but it is fairly new, and so should be
4159 treated with caution.
4161 If this doesn't make any sense to you, just accept the default '$dflt'.
4163 rp='Build a threading Perl?'
4166 y|Y) val="$define" ;;
4172 if $test $patchlevel -lt 9; then
4173 case "$usethreads" in
4177 Since release 5.6, Perl has had two different threading implementations,
4178 the newer interpreter-based version (ithreads) with one interpreter per
4179 thread, and the older 5.005 version (5005threads).
4180 The 5005threads version is effectively unmaintained and will probably be
4181 removed in Perl 5.10, so there should be no need to build a Perl using it
4182 unless needed for backwards compatibility with some existing 5.005threads
4186 : Default to ithreads unless overridden on command line or with
4189 case "$use5005threads" in
4190 $define|true|[yY]*) dflt='n';;
4192 case "$useithreads" in
4193 $undef|false|[nN]*) dflt='n';;
4195 rp='Use the newer interpreter-based ithreads?'
4198 y|Y) val="$define" ;;
4203 : Now set use5005threads to the opposite value.
4204 case "$useithreads" in
4205 $define) val="$undef" ;;
4212 useithreads="$undef"
4213 use5005threads="$undef"
4217 case "$useithreads$use5005threads" in
4221 You cannot have both the ithreads and the 5.005 threads enabled
4222 at the same time. Disabling the 5.005 threads since they are
4223 much less stable than the ithreads.
4226 use5005threads="$undef"
4231 : perl-5.9.x and later
4233 if test X"$usethreads" = "X$define"; then
4234 case "$use5005threads" in
4238 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4245 use5005threads="$undef"
4246 useithreads="$usethreads"
4249 case "$d_oldpthreads" in
4250 '') : Configure tests would be welcome here. For now, assume undef.
4252 *) val="$d_oldpthreads" ;;
4258 : Look for a hint-file generated 'call-back-unit'. If the
4259 : user has specified that a threading perl is to be built,
4260 : we may need to set or change some other defaults.
4261 if $test -f usethreads.cbu; then
4262 echo "Your platform has some specific hints regarding threaded builds, using them..."
4265 case "$usethreads" in
4266 "$define"|true|[yY]*)
4268 (Your platform does not have any specific hints for threaded builds.
4269 Assuming POSIX threads, then.)
4275 : Check if multiplicity is required
4278 Perl can be built so that multiple Perl interpreters can coexist
4279 within the same Perl executable.
4282 case "$useithreads" in
4285 This multiple interpreter support is required for interpreter-based threads.
4289 *) case "$usemultiplicity" in
4290 $define|true|[yY]*) dflt='y';;
4294 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4295 rp='Build Perl for multiplicity?'
4298 y|Y) val="$define" ;;
4306 : Check if morebits is requested
4307 case "$usemorebits" in
4308 "$define"|true|[yY]*)
4309 use64bitint="$define"
4310 uselongdouble="$define"
4311 usemorebits="$define"
4313 *) usemorebits="$undef"
4317 : Determine the C compiler to be used
4323 rp="Use which C compiler?"
4327 : See whether they have no cc but they do have gcc
4329 if $test -f cc.cbu; then
4334 : make some quick guesses about what we are up against
4336 $echo $n "Hmm... $c"
4346 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4347 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4349 echo "Looks kind of like an OSF/1 system, but we'll see..."
4351 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4352 xxx=`./loc addbib blurfl $pth`
4353 if $test -f $xxx; then
4354 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4358 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4359 echo "Looks kind of like an extended USG system, but we'll see..."
4361 echo "Looks kind of like a USG system, but we'll see..."
4365 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4366 echo "Looks kind of like a BSD system, but we'll see..."
4370 echo "Looks kind of like a Version 7 system, but we'll see..."
4373 case "$eunicefix" in
4376 There is, however, a strange, musty smell in the air that reminds me of
4377 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4381 : it so happens the Eunice I know will not run shell scripts in Unix format
4385 echo "Congratulations. You aren't running Eunice."
4389 : Detect OS2. The p_ variable is set above in the Head.U unit.
4390 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4391 : semicolon as a patch separator
4396 I have the feeling something is not exactly right, however...don't tell me...
4397 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4398 (Or you may be running DOS with DJGPP.)
4403 if test -f /xenix; then
4404 echo "Actually, this looks more like a XENIX system..."
4409 echo "It's not Xenix..."
4414 if test -f /venix; then
4415 echo "Actually, this looks more like a VENIX system..."
4422 echo "Nor is it Venix..."
4425 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4426 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4429 : Check if we are using GNU gcc and what its version is
4431 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4435 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4437 printf("%s\n", __VERSION__);
4439 printf("%s\n", "1");
4445 if $cc -o try $ccflags $ldflags try.c; then
4446 gccversion=`$run ./try`
4447 case "$gccversion" in
4448 '') echo "You are not using GNU cc." ;;
4449 *) echo "You are using GNU cc $gccversion."
4455 echo "*** WHOA THERE!!! ***" >&4
4456 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4457 case "$knowitall" in
4459 echo " You'd better start hunting for one and let me know about it." >&4
4465 case "$gccversion" in
4466 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4468 case "$gccversion" in
4469 '') gccosandvers='' ;;
4470 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4471 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4473 case "$gccosandvers" in
4474 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4475 $osname$osvers) ;; # looking good
4476 $osname*) cat <<EOM >&4
4478 *** WHOA THERE!!! ***
4480 Your gcc has not been compiled for the exact release of
4481 your operating system ($gccosandvers versus $osname$osvers).
4483 In general it is a good idea to keep gcc synchronized with
4484 the operating system because otherwise serious problems
4485 may ensue when trying to compile software, like Perl.
4487 I'm trying to be optimistic here, though, and will continue.
4488 If later during the configuration and build icky compilation
4489 problems appear (headerfile conflicts being the most common
4490 manifestation), I suggest reinstalling the gcc to match
4491 your operating system release.
4495 *) gccosandvers='' ;; # failed to parse, better be silent
4503 # gcc 3.* complain about adding -Idirectories that they already know about,
4504 # so we will take those off from locincpth.
4505 case "$gccversion" in
4507 echo "main(){}">try.c
4508 for incdir in $locincpth; do
4509 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4510 grep '^c[cp]p*[01]: warning: changing search order '`
4511 if test "X$warn" != X; then
4512 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4518 : What should the include directory be ?
4520 $echo $n "Hmm... $c"
4524 if $test -f /bin/mips && /bin/mips; then
4525 echo "Looks like a MIPS system..."
4526 $cat >usr.c <<'EOCP'
4527 #ifdef SYSTYPE_BSD43
4531 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4532 dflt='/bsd43/usr/include'
4536 mips_type='System V'
4538 $rm -f usr.c usr.out
4539 echo "and you're compiling with the $mips_type compiler and libraries."
4543 echo "Doesn't look like a MIPS system."
4553 case "$xxx_prompt" in
4556 rp='Where are the include files you want to use?'
4564 : see how we invoke the C preprocessor
4566 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4567 cat <<'EOT' >testcpp.c
4573 if test ! -f cppstdin; then
4574 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4575 # AIX cc -E doesn't show the absolute headerfile
4576 # locations but we'll cheat by using the -M flag.
4577 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
4579 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4582 echo "Keeping your $hint cppstdin wrapper."
4585 wrapper=`pwd`/cppstdin
4589 if $test "X$cppstdin" != "X" && \
4590 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4591 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4593 echo "You used to use $cppstdin $cppminus so we'll use that again."
4595 '') echo "But let's see if we can live without a wrapper..." ;;
4597 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4598 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4600 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4603 echo "(However, $cpprun $cpplast does not work, let's see...)"
4611 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4618 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4619 $cc -E <testcpp.c >testcpp.out 2>&1; \
4620 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4621 echo "Yup, it does."
4624 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4625 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4626 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4627 echo "Yup, it does."
4630 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4631 $cc -P <testcpp.c >testcpp.out 2>&1; \
4632 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4633 echo "Yipee, that works!"
4636 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4637 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4638 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4639 echo "At long last!"
4642 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4643 $cpp <testcpp.c >testcpp.out 2>&1; \
4644 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4648 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4649 $cpp - <testcpp.c >testcpp.out 2>&1; \
4650 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4651 echo "Hooray, it works! I was beginning to wonder."
4654 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4655 $wrapper <testcpp.c >testcpp.out 2>&1; \
4656 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4662 rp="No dice. I can't find a C preprocessor. Name one:"
4666 $x_cpp <testcpp.c >testcpp.out 2>&1
4667 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4668 echo "OK, that will do." >&4
4670 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4685 echo "Perhaps can we force $cc -E using a wrapper..."
4686 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4687 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4693 echo "Nope, we'll have to live without it..."
4707 "$wrapper"|'cppstdin') ;;
4708 *) $rm -f $wrapper;;
4710 $rm -f testcpp.c testcpp.out
4712 : Set private lib path
4715 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4720 '') dlist="$loclibpth $plibpth $glibpth";;
4721 *) dlist="$libpth";;
4724 : Now check and see which directories actually exist, avoiding duplicates
4728 if $test -d $xxx; then
4731 *) libpth="$libpth $xxx";;
4737 Some systems have incompatible or broken versions of libraries. Among
4738 the directories listed in the question below, please remove any you
4739 know not to be holding relevant libraries, and add any that are needed.
4740 Say "none" for none.
4751 rp="Directories to use for library searches?"
4758 : compute shared library extension
4761 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4771 On some systems, shared libraries may be available. Answer 'none' if
4772 you want to suppress searching of shared libraries for the remainder
4773 of this configuration.
4776 rp='What is the file extension used for shared libraries?'
4780 : Define several unixisms.
4781 : Hints files or command line option can be used to override them.
4782 : The convoluted testing is in case hints files set either the old
4785 '') case "$exe_ext" in
4787 *) _exe="$exe_ext" ;;
4792 '') case "$lib_ext" in
4799 '') case "$obj_ext" in
4806 '') case "$path_sep" in
4817 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4819 : Which makefile gets called first. This is used by make depend.
4820 case "$firstmakefile" in
4821 '') firstmakefile='makefile';;
4824 : Check is we will use socks
4826 $define|true|[yY]*) dflt='y';;
4831 Perl can be built to use the SOCKS proxy protocol library. To do so,
4832 Configure must be run with -Dusesocks. If you use SOCKS you also need
4833 to use the PerlIO abstraction layer, this will be implicitly selected.
4835 If this doesn't make any sense to you, just accept the default '$dflt'.
4837 rp='Build Perl for SOCKS?'
4840 y|Y) val="$define" ;;
4846 : Check for uselongdouble support
4848 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4851 case "$uselongdouble" in
4852 $define|true|[yY]*) dflt='y';;
4857 Perl can be built to take advantage of long doubles which
4858 (if available) may give more accuracy and range for floating point numbers.
4860 If this doesn't make any sense to you, just accept the default '$dflt'.
4862 rp='Try to use long doubles if available?'
4865 y|Y) val="$define" ;;
4871 case "$uselongdouble" in
4872 true|[yY]*) uselongdouble="$define" ;;
4875 : Look for a hint-file generated 'call-back-unit'. If the
4876 : user has specified that long doubles should be used,
4877 : we may need to set or change some other defaults.
4878 if $test -f uselongdouble.cbu; then
4879 echo "Your platform has some specific hints regarding long doubles, using them..."
4880 . ./uselongdouble.cbu
4882 case "$uselongdouble" in
4885 (Your platform does not have any specific hints for long doubles.)
4891 : Looking for optional libraries
4893 echo "Checking for optional libraries..." >&4
4898 case "$libswanted" in
4899 '') libswanted='c_s';;
4902 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4908 for thisdir in $libpth $xlibpth; do
4909 test -d $thisdir && libspath="$libspath $thisdir"
4911 for thislib in $libswanted; do
4912 for thisdir in $libspath; do
4914 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4915 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4916 $test -f "$xxx" && eval $libscheck
4917 $test -f "$xxx" && libstyle=shared
4919 if test ! -f "$xxx"; then
4920 xxx=$thisdir/lib$thislib.$so
4921 $test -f "$xxx" && eval $libscheck
4922 $test -f "$xxx" && libstyle=shared
4924 if test ! -f "$xxx"; then
4925 xxx=$thisdir/lib$thislib$_a
4926 $test -f "$xxx" && eval $libscheck
4927 $test -f "$xxx" && libstyle=static
4929 if test ! -f "$xxx"; then
4930 xxx=$thisdir/$thislib$_a
4931 $test -f "$xxx" && eval $libscheck
4932 $test -f "$xxx" && libstyle=static
4934 if test ! -f "$xxx"; then
4935 xxx=$thisdir/lib${thislib}_s$_a
4936 $test -f "$xxx" && eval $libscheck
4937 $test -f "$xxx" && libstyle=static
4938 $test -f "$xxx" && thislib=${thislib}_s
4940 if test ! -f "$xxx"; then
4941 xxx=$thisdir/Slib$thislib$_a
4942 $test -f "$xxx" && eval $libscheck
4943 $test -f "$xxx" && libstyle=static
4945 if $test -f "$xxx"; then
4947 shared) echo "Found -l$thislib (shared)." ;;
4948 static) echo "Found -l$thislib." ;;
4949 *) echo "Found -l$thislib ($libstyle)." ;;
4953 *) dflt="$dflt -l$thislib"
4954 libsfound="$libsfound $xxx"
4956 libsfiles="$libsfiles $yyy"
4957 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4958 case " $libsdirs " in
4960 *) libsdirs="$libsdirs $yyy" ;;
4967 if $test ! -f "$xxx"; then
4968 echo "No -l$thislib."
4979 ' '|'') dflt='none';;
4984 In order to compile $package on your machine, a number of libraries
4985 are usually needed. Include any other special libraries here as well.
4986 Say "none" for none. The default list is almost always right.
4990 rp="What libraries to use?"
4997 : determine optimization, if desired, or use for debug flag also
4999 ' '|$undef) dflt='none';;
5001 *) dflt="$optimize";;
5005 By default, $package compiles with the -O flag to use the optimizer.
5006 Alternately, you might want to use the symbolic debugger, which uses
5007 the -g flag (on traditional Unix systems). Either flag can be
5008 specified here. To use neither flag, specify the word "none".
5011 rp="What optimizer/debugger flag should be used?"
5015 'none') optimize=" ";;
5018 : Check what DEBUGGING is required from the command line
5019 : -DEBUGGING or -DDEBUGGING or
5020 : -DEBUGGING=both = -g + -DDEBUGGING
5021 : -DEBUGGING=-g or -Doptimize=-g = -g
5022 : -DEBUGGING=none or -UDEBUGGING =
5023 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5026 *) DEBUGGING=$EBUGGING ;;
5029 case "$DEBUGGING" in
5033 *) optimize="$optimize -g" ;;
5037 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5045 case "$DEBUGGING" in
5046 both|$define) dflt='-DDEBUGGING'
5049 : argument order is deliberate, as the flag will start with - which set could
5050 : think is an option
5051 checkccflag='check=$1; flag=$2; callback=$3;
5053 echo "Checking if your compiler accepts $flag" 2>&1;
5054 echo "int main(void) { return 0; }" > gcctest.c;
5055 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5056 echo "Yes, it does." 2>&1;
5057 if $test -s gcctest.out ; then
5058 echo "But your platform does not like it:";
5063 echo "Leaving current flags $ccflags alone." 2>&1
5065 *) dflt="$dflt $flag";
5071 echo "Nope, it does not, but that is ok." 2>&1;
5075 : We will not override a previous value, but we might want to
5076 : augment a hint file
5078 default|recommended)
5079 case "$gccversion" in
5080 1*) dflt="$dflt -fpcc-struct-return" ;;
5082 case "$optimize:$DEBUGGING" in
5083 *-g*:old) dflt="$dflt -DDEBUGGING";;
5085 case "$gccversion" in
5086 2*) if $test -d /etc/conf/kconfig.d &&
5087 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5089 # Interactive Systems (ISC) POSIX mode.
5094 case "$gccversion" in
5097 ?*) set strict-aliasing -fno-strict-aliasing
5101 # For gcc, adding -pipe speeds up compilations for some, but apparently
5102 # some assemblers can't read from stdin. (It also slows down compilations
5103 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5104 case "$gccversion" in
5110 # on x86_64 (at least) we require an extra library (libssp) in the
5111 # link command line. This library is not named, so I infer that it is
5112 # an implementation detail that may change. Hence the safest approach
5113 # is to add the flag to the flags passed to the compiler at link time,
5114 # as that way the compiler can do the right implementation dependant
5116 case "$gccversion" in
5117 ?*) set stack-protector -fstack-protector
5124 case "$mips_type" in
5125 *BSD*|'') inclwanted="$locincpth $usrinc";;
5126 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5128 for thisincl in $inclwanted; do
5129 if $test -d $thisincl; then
5130 if $test x$thisincl != x$usrinc; then
5132 *" -I$thisincl "*);;
5133 *) dflt="$dflt -I$thisincl ";;
5139 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5141 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5149 *) dflt="$dflt -D$2";;
5153 set signal.h LANGUAGE_C; eval $inctest
5157 ccflags="$ccflags -DSOCKS"
5162 default|recommended) dflt="$ccflags $dflt" ;;
5163 *) dflt="$ccflags";;
5172 Your C compiler may want other flags. For this question you should include
5173 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5174 but you should NOT include libraries or ld flags like -lwhatever. If you
5175 want $package to honor its debug switch, you should include -DDEBUGGING here.
5176 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5178 To use no flags, specify the word "none".
5184 rp="Any additional cc flags?"
5191 : the following weeds options from ccflags that are of no interest to cpp
5193 '') cppflags="$ccflags" ;;
5194 *) cppflags="$cppflags $ccflags" ;;
5196 case "$gccversion" in
5197 1*) cppflags="$cppflags -D__GNUC__"
5199 case "$mips_type" in
5201 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5207 echo "Let me guess what the preprocessor flags are..." >&4
5221 *) ftry="$previous $flag";;
5223 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5224 >cpp1.out 2>/dev/null && \
5225 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5226 >cpp2.out 2>/dev/null && \
5227 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5228 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5230 cppflags="$cppflags $ftry"
5240 *-*) echo "They appear to be: $cppflags";;
5242 $rm -f cpp.c cpp?.out
5246 : flags used in final linking phase
5248 '') if ./venix; then
5254 *-posix*) dflt="$dflt -posix" ;;
5257 *) dflt="$ldflags";;
5259 # See note above about -fstack-protector
5261 *-fstack-protector*)
5263 *-fstack-protector*) ;; # Don't add it again
5264 *) dflt="$dflt -fstack-protector" ;;
5269 : Try to guess additional flags to pick up local libraries.
5270 for thislibdir in $libpth; do
5271 case " $loclibpth " in
5274 *"-L$thislibdir "*) ;;
5275 *) dflt="$dflt -L$thislibdir" ;;
5287 Your C linker may need flags. For this question you should
5288 include -L/whatever and any other flags used by the C linker, but you
5289 should NOT include libraries like -lwhatever.
5291 Make sure you include the appropriate -L/path flags if your C linker
5292 does not normally search all of the directories you specified above,
5295 To use no flags, specify the word "none".
5299 rp="Any additional ld flags (NOT including libraries)?"
5305 rmlist="$rmlist pdp11"
5309 echo "Checking your choice of C compiler and flags for coherency..." >&4
5310 $cat > try.c <<'EOF'
5312 int main() { printf("Ok\n"); return(0); }
5314 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5316 $cat >try.msg <<'EOM'
5317 I've tried to compile and run the following simple program:
5320 $cat try.c >> try.msg
5322 $cat >> try.msg <<EOM
5329 and I got the following output:
5333 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5334 if $sh -c "$run ./try " >>try.msg 2>&1; then
5338 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5341 cat >> try.msg <<'EOQS'
5342 If $libs contains -lsfio, and sfio is mis-configured, then it
5343 sometimes (apparently) runs and exits with a 0 status, but with no
5344 output! It may have to do with sfio's use of _exit vs. exit.
5347 rp="You have a big problem. Shall I abort Configure"
5354 echo "The program compiled OK, but exited with status $?." >>try.msg
5355 rp="You have a problem. Shall I abort Configure"
5359 echo "I can't compile the test program." >>try.msg
5360 rp="You have a BIG problem. Shall I abort Configure"
5366 case "$knowitall" in
5368 echo "(The supplied flags or libraries might be incorrect.)"
5376 *) echo "Ok. Stopping Configure." >&4
5381 n) echo "OK, that should do.";;
5383 $rm_try gcctest gcctest.out
5385 : define a shorthand compile call
5389 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5390 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5394 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5395 : define a shorthand compile call for compilations that should be ok.
5399 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5401 : determine filename position in cpp output
5403 echo "Computing filename position in cpp output for #include directives..." >&4
5405 vos) testaccess=-e ;;
5408 echo '#include <stdio.h>' > foo.c
5411 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5412 $grep '^[ ]*#.*stdio\.h' | \
5413 while read cline; do
5416 while $test \$# -gt 0; do
5417 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5422 pos=\`expr \$pos + 1\`
5434 *) pos="${fieldn}th";;
5436 echo "Your cpp writes the filename in the $pos field of the line."
5439 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5440 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5443 : locate header file
5448 for usrincdir in $usrinc
5450 if test -f \$usrincdir/\$wanted; then
5451 echo "\$usrincdir/\$wanted"
5455 awkprg='{ print \$$fieldn }'
5456 echo "#include <\$wanted>" > foo\$\$.c
5457 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5458 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5459 while read cline; do
5460 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5462 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5463 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5468 # status = 0: grep returned 0 lines, case statement not executed
5469 # status = 1: headerfile found
5470 # status = 2: while loop executed, no headerfile found
5474 if test \$status -eq 1; then
5481 : define an alternate in-header-list? function
5482 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5483 cont=true; xxf="echo \"<\$1> found.\" >&4";
5484 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5485 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5487 case $# in 4) instead=instead;; *) instead="at last";; esac;
5488 while $test "$cont"; do
5490 var=$2; eval "was=\$$2";
5491 if $test "$xxx" && $test -r "$xxx";
5493 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5496 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5497 set $yyy; shift; shift; yyy=$@;
5498 case $# in 0) cont="";;
5499 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5500 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5501 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5502 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5506 do set $yyy; var=$2; eval "was=\$$2";
5507 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5508 set $yyy; shift; shift; yyy=$@;
5511 : see if stdlib is available
5512 set stdlib.h i_stdlib
5515 : check for lengths of integral types
5519 echo "Checking to see how big your integers are..." >&4
5528 printf("intsize=%d;\n", (int)sizeof(int));
5529 printf("longsize=%d;\n", (int)sizeof(long));
5530 printf("shortsize=%d;\n", (int)sizeof(short));
5535 if eval $compile_ok && $run ./try > /dev/null; then
5537 echo "Your integers are $intsize bytes long."
5538 echo "Your long integers are $longsize bytes long."
5539 echo "Your short integers are $shortsize bytes long."
5543 Help! I can't compile and run the intsize test program: please enlighten me!
5544 (This is probably a misconfiguration in your system or libraries, and
5545 you really ought to fix it. Still, I'll try anyway.)
5549 rp="What is the size of an integer (in bytes)?"
5553 rp="What is the size of a long integer (in bytes)?"
5557 rp="What is the size of a short integer (in bytes)?"
5565 : check for long long
5567 echo "Checking to see if you have long long..." >&4
5568 echo 'int main() { long long x = 7; return 0; }' > try.c
5570 if eval $compile; then
5572 echo "You have long long."
5575 echo "You do not have long long."
5581 : check for length of long long
5582 case "${d_longlong}${longlongsize}" in
5585 echo "Checking to see how big your long longs are..." >&4
5586 $cat >try.c <<'EOCP'
5590 printf("%d\n", (int)sizeof(long long));
5595 if eval $compile_ok; then
5596 longlongsize=`$run ./try`
5597 echo "Your long longs are $longlongsize bytes long."
5601 echo "(I can't seem to compile the test program. Guessing...)"
5602 rp="What is the size of a long long (in bytes)?"
5606 if $test "X$longsize" = "X$longlongsize"; then
5607 echo "(That isn't any different from an ordinary long.)"
5613 : see if inttypes.h is available
5614 : we want a real compile instead of Inhdr because some systems
5615 : have an inttypes.h which includes non-existent headers
5618 #include <inttypes.h>
5620 static int32_t foo32 = 0x12345678;
5624 if eval $compile; then
5625 echo "<inttypes.h> found." >&4
5628 echo "<inttypes.h> NOT found." >&4
5637 echo "Checking to see if you have int64_t..." >&4
5639 #include <sys/types.h>
5640 #$i_inttypes I_INTTYPES
5642 #include <inttypes.h>
5644 int main() { int64_t x = 7; }
5647 if eval $compile; then
5649 echo "You have int64_t."
5652 echo "You do not have int64_t."
5658 : Check if 64bit ints have a quad type
5660 echo "Checking which 64-bit integer type we could use..." >&4
5666 val='"unsigned int"'
5671 *) case "$longsize" in
5675 val='"unsigned long"'
5680 *) case "$d_longlong:$longlongsize" in
5685 val='"unsigned long long"'
5690 *) case "$d_int64_t" in
5709 '') echo "Alas, no 64-bit integer types in sight." >&4
5712 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5717 : Do we want 64bit support
5718 case "$uselonglong" in
5719 "$define"|true|[yY]*)
5722 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5724 use64bitint="$define"
5727 case "$use64bits" in
5728 "$define"|true|[yY]*)
5731 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5733 use64bitint="$define"
5736 case "$use64bitints" in
5737 "$define"|true|[yY]*)
5740 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5742 use64bitint="$define"
5745 case "$use64bitsint" in
5746 "$define"|true|[yY]*)
5749 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5751 use64bitint="$define"
5754 case "$uselonglongs" in
5755 "$define"|true|[yY]*)
5758 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5760 use64bitint="$define"
5763 case "$use64bitsall" in
5764 "$define"|true|[yY]*)
5767 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5769 use64bitall="$define"
5774 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5776 case "$use64bitall" in
5777 "$define"|true|[yY]*) use64bitint="$define" ;;
5783 You have natively 64-bit long integers.
5787 *) case "$use64bitint" in
5788 "$define"|true|[yY]*) dflt='y';;
5797 Perl can be built to take advantage of 64-bit integer types
5798 on some systems. To do so, Configure can be run with -Duse64bitint.
5799 Choosing this option will most probably introduce binary incompatibilities.
5801 If this doesn't make any sense to you, just accept the default '$dflt'.
5802 (The default has been chosen based on your configuration.)
5804 rp='Try to use 64-bit integers, if available?'
5807 [yY]*) val="$define" ;;
5815 case "$use64bitall" in
5816 "$define"|true|[yY]*) dflt='y' ;;
5817 *) case "$longsize" in
5825 You may also choose to try maximal 64-bitness. It means using as much
5826 64-bitness as possible on the platform. This in turn means even more
5827 binary incompatibilities. On the other hand, your platform may not
5828 have any more 64-bitness available than what you already have chosen.
5830 If this doesn't make any sense to you, just accept the default '$dflt'.
5831 (The default has been chosen based on your configuration.)
5833 rp='Try to use maximal 64-bit support, if available?'
5836 [yY]*) val="$define" ;;
5841 case "$use64bitall" in
5843 case "$use64bitint" in
5847 Since you have chosen a maximally 64-bit build, I'm also turning on
5848 the use of 64-bit integers.
5850 use64bitint="$define" ;;
5855 : Look for a hint-file generated 'call-back-unit'. If the
5856 : user has specified that a 64-bit perl is to be built,
5857 : we may need to set or change some other defaults.
5858 if $test -f use64bitint.cbu; then
5859 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5862 case "$use64bitint" in
5863 "$define"|true|[yY]*)
5865 4) case "$archname64" in
5866 '') archname64=64int ;;
5873 : Look for a hint-file generated 'call-back-unit'. If the
5874 : user has specified that a maximally 64-bit perl is to be built,
5875 : we may need to set or change some other defaults.
5876 if $test -f use64bitall.cbu; then
5877 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5880 case "$use64bitall" in
5881 "$define"|true|[yY]*)
5883 4) case "$archname64" in
5884 ''|64int) archname64=64all ;;
5891 case "$d_quad:$use64bitint" in
5895 *** You have chosen to use 64-bit integers,
5896 *** but none can be found.
5897 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5898 *** Cannot continue, aborting.
5905 : check for length of double
5907 case "$doublesize" in
5909 echo "Checking to see how big your double precision numbers are..." >&4
5918 printf("%d\n", (int)sizeof(double));
5923 if eval $compile_ok; then
5924 doublesize=`$run ./try`
5925 echo "Your double is $doublesize bytes long."
5928 echo "(I can't seem to compile the test program. Guessing...)"
5929 rp="What is the size of a double precision number (in bytes)?"
5937 : check for long doubles
5939 echo "Checking to see if you have long double..." >&4
5940 echo 'int main() { long double x = 7.0; }' > try.c
5942 if eval $compile; then
5944 echo "You have long double."
5947 echo "You do not have long double."
5953 : check for length of long double
5954 case "${d_longdbl}${longdblsize}" in
5957 echo "Checking to see how big your long doubles are..." >&4
5958 $cat >try.c <<'EOCP'
5962 printf("%d\n", sizeof(long double));
5967 if eval $compile; then
5968 longdblsize=`$run ./try`
5969 echo "Your long doubles are $longdblsize bytes long."
5973 echo "(I can't seem to compile the test program. Guessing...)" >&4
5974 rp="What is the size of a long double (in bytes)?"
5978 if $test "X$doublesize" = "X$longdblsize"; then
5979 echo "That isn't any different from an ordinary double."
5980 echo "I'll keep your setting anyway, but you may see some"
5981 echo "harmless compilation warnings."
5987 : determine the architecture name
5989 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5990 tarch=`arch`"-$osname"
5991 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5992 if uname -m > tmparch 2>&1 ; then
5993 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5994 -e 's/$/'"-$osname/" tmparch`
6002 case "$myarchname" in
6005 echo "(Your architecture name used to be $myarchname.)"
6009 case "$targetarch" in
6011 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6016 *) dflt="$archname";;
6018 rp='What is your architecture name'
6022 : optionally add api version to the architecture for versioned archlibs
6023 case "$useversionedarchname" in
6024 $define|true|[yY]*) dflt='y';;
6027 rp='Add the Perl API version to your archname?'
6030 y|Y) useversionedarchname="$define" ;;
6031 *) useversionedarchname="$undef" ;;
6033 case "$useversionedarchname" in
6036 *-$api_versionstring)
6037 echo "...and architecture name already has -$api_versionstring" >&4
6040 archname="$archname-$api_versionstring"
6041 echo "...setting architecture name to $archname." >&4
6047 case "$usethreads" in
6049 echo "Threads selected." >&4
6051 *-thread*) echo "...and architecture name already has -thread." >&4
6053 *) archname="$archname-thread"
6054 echo "...setting architecture name to $archname." >&4
6059 case "$usemultiplicity" in
6061 echo "Multiplicity selected." >&4
6063 *-multi*) echo "...and architecture name already has -multi." >&4
6065 *) archname="$archname-multi"
6066 echo "...setting architecture name to $archname." >&4
6071 case "$use64bitint$use64bitall" in
6073 case "$archname64" in
6075 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6078 case "$use64bitint" in
6079 "$define") echo "64 bit integers selected." >&4 ;;
6081 case "$use64bitall" in
6082 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6085 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6087 *) archname="$archname-$archname64"
6088 echo "...setting architecture name to $archname." >&4
6094 case "$uselongdouble" in
6096 echo "Long doubles selected." >&4
6097 case "$longdblsize" in
6099 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6103 *-ld*) echo "...and architecture name already has -ld." >&4
6105 *) archname="$archname-ld"
6106 echo "...setting architecture name to $archname." >&4
6113 if $test -f archname.cbu; then
6114 echo "Your platform has some specific hints for architecture name, using them..."
6118 : set the prefixit variable, to compute a suitable default value
6119 prefixit='case "$3" in
6121 case "$oldprefix" in
6122 "") eval "$1=\"\$$2\"";;
6129 ""|" ") eval "$1=\"\$$2\"";;
6135 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6137 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6138 /*-$oldprefix/*|\~*-$oldprefix/*)
6139 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6140 *) eval "$1=\"\$$2\"";;
6144 : determine installation style
6145 : For now, try to deduce it from prefix unless it is already set.
6146 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6147 case "$installstyle" in
6148 '') case "$prefix" in
6149 *perl*) dflt='lib';;
6150 *) dflt='lib/perl5' ;;
6153 *) dflt="$installstyle" ;;
6155 : Probably not worth prompting for this since we prompt for all
6156 : the directories individually, and the prompt would be too long and
6160 : determine where public executables go
6165 rp='Pathname where the public executables will reside?'
6167 if $test "X$ansexp" != "X$binexp"; then
6171 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6172 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6173 : this via initialinstalllocation
6176 case "$userelocatableinc" in
6177 $define|true|[yY]*) dflt='y' ;;
6182 Would you like to build Perl so that the installation is relocatable, so that
6183 library paths in @INC are determined relative to the path of the perl binary?
6184 This is not advised for system Perl installs, or if you need to run setid
6185 scripts or scripts under taint mode.
6187 If this doesn't make any sense to you, just accept the default '$dflt'.
6189 rp='Use relocatable @INC?'
6192 y|Y) val="$define" ;;
6195 set userelocatableinc
6198 initialinstalllocation="$binexp"
6199 : Default prefix is now "up one level from where the binaries are"
6200 case "$userelocatableinc" in
6206 installprefixexp=".../.."
6210 : determine where private library files go
6211 : Usual default is /usr/local/lib/perl5/$version.
6212 : Also allow things like /opt/perl/lib/$version, since
6213 : /opt/perl/lib/perl5... would be redundant.
6214 : The default "style" setting is made in installstyle.U
6215 case "$installstyle" in
6216 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6217 *) set dflt privlib lib/$version ;;
6222 There are some auxiliary files for $package that need to be put into a
6223 private library directory that is accessible by everyone.
6228 rp='Pathname where the private library files will reside?'
6233 : set the prefixup variable, to restore leading tilda escape
6234 prefixup='case "$prefixexp" in
6236 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6239 : determine where public architecture dependent libraries go
6242 : privlib default is /usr/local/lib/$package/$version
6243 : archlib default is /usr/local/lib/$package/$version/$archname
6244 : privlib may have an optional trailing /share.
6245 tdflt=`echo $privlib | $sed 's,/share$,,'`
6246 tdflt=$tdflt/$archname
6255 $spackage contains architecture-dependent library files. If you are
6256 sharing libraries in a heterogeneous environment, you might store
6257 these files in a separate location. Otherwise, you can just include
6258 them with the rest of the public library files.
6263 rp='Where do you want to put the public architecture-dependent libraries?'
6267 if $test X"$archlib" = X"$privlib"; then
6273 : see if setuid scripts can be secure
6276 Some kernels have a bug that prevents setuid #! scripts from being
6277 secure. Some sites have disabled setuid #! scripts because of this.
6279 First let's decide if your kernel supports secure setuid #! scripts.
6280 (If setuid #! scripts would be secure but have been disabled anyway,
6281 don't say that they are secure if asked.)
6286 if $test -d /dev/fd; then
6287 echo "#!$ls" >reflect
6288 chmod +x,u+s reflect
6289 ./reflect >flect 2>&1
6290 if $contains "/dev/fd" flect >/dev/null; then
6291 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6295 If you are not sure if they are secure, I can check but I'll need a
6296 username and password different from the one you are using right now.
6297 If you don't have such a username or don't want me to test, simply
6301 rp='Other username to test security of setuid scripts with?'
6306 case "$d_suidsafe" in
6307 '') echo "I'll assume setuid scripts are *not* secure." >&4
6310 echo "Well, the $hint value is *not* secure." >&4
6312 *) echo "Well, the $hint value *is* secure." >&4
6317 $rm -f reflect flect
6318 echo "#!$ls" >reflect
6319 chmod +x,u+s reflect
6322 echo '"su" will (probably) prompt you for '"$ans's password."
6323 su $ans -c './reflect >flect'
6324 if $contains "/dev/fd" flect >/dev/null; then
6325 echo "Okay, it looks like setuid scripts are secure." >&4
6328 echo "I don't think setuid scripts are secure." >&4
6333 rp='Does your kernel have *secure* setuid scripts?'
6336 [yY]*) val="$define";;
6341 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6342 echo "(That's for file descriptors, not floppy disks.)"
6348 $rm -f reflect flect
6350 : now see if they want to do setuid emulation
6351 if $test $patchlevel -lt 11; then
6354 case "$d_suidsafe" in
6357 echo "No need to emulate SUID scripts since they are secure here." >&4
6361 Some systems have disabled setuid scripts, especially systems where
6362 setuid scripts cannot be secure. On systems where setuid scripts have
6363 been disabled, the setuid/setgid bits on scripts are currently
6364 useless. It is possible for $package to detect those bits and emulate
6365 setuid/setgid in a secure fashion. This emulation will only work if
6366 setuid scripts have been disabled in your kernel.
6370 "$define") dflt=y ;;
6373 rp="Do you want to do setuid/setgid emulation?"
6376 [yY]*) val="$define";;
6388 SUID emulation has been removed for 5.12
6389 Please re-run Configure without -Dd_dosuid
6398 : Find perl5.005 or later.
6399 echo "Looking for a previously installed perl5.005 or later... "
6401 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6402 : Check if this perl is recent and can load a simple module
6403 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6406 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6416 '') echo "None found. That's ok.";;
6417 *) echo "Using $perl5." ;;
6420 : Set the siteprefix variables
6423 After $package is installed, you may wish to install various
6424 add-on modules and utilities. Typically, these add-ons will
6425 be installed under $prefix with the rest
6426 of this package. However, you may wish to install such add-ons
6427 elsewhere under a different prefix.
6429 If you do not wish to put everything under a single prefix, that's
6430 ok. You will be prompted for the individual locations; this siteprefix
6431 is only used to suggest the defaults.
6433 The default should be fine for most people.
6437 rp='Installation prefix to use for add-on modules and utilities?'
6438 : XXX Here might be another good place for an installstyle setting.
6439 case "$siteprefix" in
6441 *) dflt=$siteprefix ;;
6444 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6446 case "$siteprefix" in
6450 *) oldsiteprefix="$prefix";;
6455 siteprefixexp="$ansexp"
6457 : determine where site specific libraries go.
6458 : Usual default is /usr/local/lib/perl5/site_perl/$version
6459 : The default "style" setting is made in installstyle.U
6460 : XXX No longer works with Prefixit stuff.
6461 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6463 '') case "$installstyle" in
6464 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6465 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6473 The installation process will create a directory for
6474 site-specific extensions and modules. Most users find it convenient
6475 to place all site-specific files in this directory rather than in the
6476 main distribution directory.
6480 rp='Pathname for the site-specific library files?'
6484 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6486 : Determine list of previous versions to include in @INC
6487 $cat > getverlist <<EOPL
6490 \$api_versionstring = "$api_versionstring";
6491 \$version = "$version";
6492 \$stem = "$sitelib_stem";
6493 \$archname = "$archname";
6495 $cat >> getverlist <<'EOPL'
6496 # The list found is store twice for each entry: the original name, and
6497 # the binary broken down version as pack "sss", so sorting is easy and
6498 # unambiguous. This will work for all versions that have a maximum of
6499 # three digit groups, separate by '.'s or '_'s. Names are extended with
6500 # ".0.0" to ensure at least three elements for the pack.
6501 # -- H.Merijn Brand (m)'06 23-10-2006
6503 # Can't have leading @ because metaconfig interprets it as a command!
6504 ;@inc_version_list=();
6505 # XXX Redo to do opendir/readdir?
6508 ;@candidates = map {
6509 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6510 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6516 ($pversion, $aversion, $vsn5005) = map {
6517 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6518 foreach $d (@candidates) {
6519 if ($d->[1] lt $pversion) {
6520 if ($d->[1] ge $aversion) {
6521 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6523 elsif ($d->[1] ge $vsn5005) {
6524 unshift(@inc_version_list, grep { -d } $d->[0]);
6528 # Skip newer version. I.e. don't look in
6529 # 5.7.0 if we're installing 5.6.1.
6533 if (@inc_version_list) {
6534 print join(' ', @inc_version_list);
6537 # Blank space to preserve value for next Configure run.
6542 case "$inc_version_list" in
6543 '') if test -x "$perl5$exe_ext"; then
6544 dflt=`$perl5 getverlist`
6549 $undef) dflt='none' ;;
6550 *) eval dflt=\"$inc_version_list\" ;;
6553 ''|' ') dflt=none ;;
6560 In order to ease the process of upgrading, this version of perl
6561 can be configured to use modules built and installed with earlier
6562 versions of perl that were installed under $prefix. Specify here
6563 the list of earlier versions that this version of perl should check.
6564 If Configure detected no earlier versions of perl installed under
6565 $prefix, then the list will be empty. Answer 'none' to tell perl
6566 to not search earlier versions.
6568 The default should almost always be sensible, so if you're not sure,
6569 just accept the default.
6572 rp='List of earlier versions to include in @INC?'
6575 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6576 *) inc_version_list="$ans" ;;
6578 case "$inc_version_list" in
6580 inc_version_list_init='0'
6581 d_inc_version_list="$undef"
6583 *) inc_version_list_init=`echo $inc_version_list |
6584 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6585 d_inc_version_list="$define"
6590 : see if malloc/malloc.h has to be included
6591 set malloc/malloc.h i_mallocmalloc
6594 : see if this is a malloc.h system
6595 : we want a real compile instead of Inhdr because some systems have a
6596 : malloc.h that just gives a compile error saying to use stdlib.h instead
6601 #$i_mallocmalloc I_MALLOCMALLOC
6602 #ifdef I_MALLOCMALLOC
6603 # include <malloc/malloc.h>
6606 int main () { return 0; }
6609 if eval $compile; then
6610 echo "<malloc.h> found." >&4
6613 echo "<malloc.h> NOT found." >&4
6620 : check for void type
6622 echo "Checking to see how well your C compiler groks the void type..." >&4
6623 case "$voidflags" in
6635 extern void moo(); /* function returning void */
6636 void (*goo)(); /* ptr to func returning void */
6638 void *hue; /* generic ptr */
6651 int main() { sub(); }
6653 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6654 voidflags=$defvoidused
6655 echo "Good. It appears to support void to the level $package wants.">&4
6656 if $contains warning .out >/dev/null 2>&1; then
6657 echo "However, you might get some warnings that look like this:"
6661 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6662 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6663 echo "It supports 1..."
6664 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6665 echo "It also supports 2..."
6666 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6668 echo "And it supports 4 but not 8 definitely."
6670 echo "It doesn't support 4..."
6671 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6673 echo "But it supports 8."
6676 echo "Neither does it support 8."
6680 echo "It does not support 2..."
6681 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6683 echo "But it supports 4 and 8."
6685 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6687 echo "And it supports 4 but has not heard about 8."
6689 echo "However it supports 8 but not 4."
6694 echo "There is no support at all for void."
6699 case "$voidflags" in
6702 Support flag bits are:
6703 1: basic void declarations.
6704 2: arrays of pointers to functions returning void.
6705 4: operations between pointers to and addresses of void functions.
6706 8: generic void pointers.
6709 rp="Your void support flags add up to what?"
6716 : check for length of pointer
6720 echo "Checking to see how big your pointers are..." >&4
6721 if test "$voidflags" -gt 7; then
6722 echo '#define VOID_PTR char *' > try.c
6724 echo '#define VOID_PTR void *' > try.c
6734 printf("%d\n", (int)sizeof(VOID_PTR));
6739 if eval $compile_ok; then
6740 ptrsize=`$run ./try`
6741 echo "Your pointers are $ptrsize bytes long."
6744 echo "(I can't seem to compile the test program. Guessing...)" >&4
6745 rp="What is the size of a pointer (in bytes)?"
6752 case "$use64bitall" in
6753 "$define"|true|[yY]*)
6757 *** You have chosen a maximally 64-bit build,
6758 *** but your pointers are only 4 bytes wide.
6759 *** Please rerun Configure without -Duse64bitall.
6764 *** Since you have quads, you could possibly try with -Duse64bitint.
6769 *** Cannot continue, aborting.
6780 : determine whether to use malloc wrapping
6782 case "$usemallocwrap" in
6783 [yY]*|true|$define) dflt='y' ;;
6784 [nN]*|false|$undef) dflt='n' ;;
6785 *) case "$usedevel" in
6786 [yY]*|true|$define) dflt='y' ;;
6791 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6793 usemallocwrap="$ans"
6796 usemallocwrap="$define" ;;
6798 usemallocwrap="$undef" ;;
6801 : determine which malloc to compile in
6803 case "$usemymalloc" in
6804 [yY]*|true|$define) dflt='y' ;;
6805 [nN]*|false|$undef) dflt='n' ;;
6806 *) case "$ptrsize" in
6810 if test "$useithreads" = "$define"; then dflt='n'; fi
6813 rp="Do you wish to attempt to use the malloc that comes with $package?"
6819 mallocsrc='malloc.c'
6820 mallocobj="malloc$_o"
6821 d_mymalloc="$define"
6824 : Remove malloc from list of libraries to use
6825 echo "Removing unneeded -lmalloc from library list" >&4
6826 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6829 echo "libs = $libs" >&4
6841 : compute the return types of malloc and free
6843 $cat >malloc.c <<END
6847 #include <sys/types.h>
6861 case "$malloctype" in
6863 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6870 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6874 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6881 echo "Your system uses $freetype free(), it would seem." >&4
6883 : determine where site specific architecture-dependent libraries go.
6884 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6885 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6886 : sitelib may have an optional trailing /share.
6888 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6889 dflt="$dflt/$archname"
6894 set sitearch sitearch none
6898 The installation process will also create a directory for
6899 architecture-dependent site-specific extensions and modules.
6903 rp='Pathname for the site-specific architecture-dependent library files?'
6907 if $test X"$sitearch" = X"$sitelib"; then
6910 d_sitearch="$define"
6913 : Set the vendorprefix variables
6916 The installation process will also create a directory for
6917 vendor-supplied add-ons. Vendors who supply perl with their system
6918 may find it convenient to place all vendor-supplied files in this
6919 directory rather than in the main distribution directory. This will
6920 ease upgrades between binary-compatible maintenance versions of perl.
6922 Of course you may also use these directories in whatever way you see
6923 fit. For example, you might use them to access modules shared over a
6924 company-wide network.
6926 The default answer should be fine for most people.
6927 This causes further questions about vendor add-ons to be skipped
6928 and no vendor-specific directories will be configured for perl.
6931 rp='Do you want to configure vendor-specific add-on directories?'
6932 case "$usevendorprefix" in
6933 define|true|[yY]*) dflt=y ;;
6934 *) : User may have set vendorprefix directly on Configure command line.
6935 case "$vendorprefix" in
6944 rp='Installation prefix to use for vendor-supplied add-ons?'
6945 case "$vendorprefix" in
6947 *) dflt=$vendorprefix ;;
6950 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6952 case "$vendorprefix" in
6956 *) oldvendorprefix="$prefix";;
6960 usevendorprefix="$define"
6962 vendorprefixexp="$ansexp"
6964 *) usevendorprefix="$undef"
6970 : Set the vendorlib variables
6971 case "$vendorprefix" in
6972 '') d_vendorlib="$undef"
6976 *) d_vendorlib="$define"
6977 : determine where vendor-supplied modules go.
6978 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6979 case "$vendorlib" in
6981 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6982 case "$installstyle" in
6983 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6984 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6987 *) dflt="$vendorlib"
6991 rp='Pathname for the vendor-supplied library files?'
6994 vendorlibexp="$ansexp"
6997 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7001 : Set the vendorarch variables
7002 case "$vendorprefix" in
7003 '') d_vendorarch="$undef"
7007 *) d_vendorarch="$define"
7008 : determine where vendor-supplied architecture-dependent libraries go.
7009 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7010 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7011 : vendorlib may have an optional trailing /share.
7012 case "$vendorarch" in
7013 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7014 dflt="$dflt/$archname"
7016 *) dflt="$vendorarch" ;;
7019 rp='Pathname for vendor-supplied architecture-dependent files?'
7022 vendorarchexp="$ansexp"
7025 prefixvar=vendorarch
7027 if $test X"$vendorarch" = X"$vendorlib"; then
7028 d_vendorarch="$undef"
7030 d_vendorarch="$define"
7033 : Final catch-all directories to search
7036 Lastly, you can have perl look in other directories for extensions and
7037 modules in addition to those already specified.
7038 These directories will be searched after
7042 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7043 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7045 case "$otherlibdirs" in
7046 ''|' ') dflt='none' ;;
7047 *) dflt="$otherlibdirs" ;;
7050 Enter a colon-separated set of extra paths to include in perl's @INC
7051 search path, or enter 'none' for no extra paths.
7055 rp='Colon-separated list of additional directories for perl to search?'
7058 ' '|''|none) otherlibdirs=' ' ;;
7059 *) otherlibdirs="$ans" ;;
7061 case "$otherlibdirs" in
7065 set d_perl_otherlibdirs
7068 : Cruising for prototypes
7070 echo "Checking out function prototypes..." >&4
7071 $cat >prototype.c <<EOCP
7076 int main(int argc, char *argv[]) {
7079 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7080 echo "Your C compiler appears to support function prototypes."
7083 echo "Your C compiler doesn't seem to understand function prototypes."
7090 : Check if ansi2knr is required
7091 case "$prototype" in
7093 *) ansi2knr='ansi2knr'
7098 This version of $package can only be compiled by a compiler that
7099 understands function prototypes. Unfortunately, your C compiler
7101 doesn't seem to understand them. Sorry about that.
7103 If GNU cc is available for your system, perhaps you could try that instead.
7105 Eventually, we hope to support building Perl with pre-ANSI compilers.
7106 If you would like to help in that effort, please contact <perlbug@perl.org>.
7108 Aborting Configure now.
7115 dflt_dtrace='/usr/sbin/dtrace'
7116 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7120 Perl can be built to support DTrace on platforms that support it.
7121 DTrace is a diagnosis and performance analysis tool from Sun.
7123 If this doesn't make any sense to you, just accept the default '$dflt'.
7127 case "$usedtrace" in
7133 dflt_dtrace=$usedtrace
7140 rp='Support DTrace if available?'
7143 y|Y) val="$define" ;;
7149 test "X$usedtrace" != "X$define" && break
7152 rp='Where is the dtrace executable?'
7161 if $dtrace -h -s ../perldtrace.d \
7162 -o perldtrace.tmp >/dev/null 2>&1 \
7163 && rm -f perldtrace.tmp
7166 echo "Good: your $dtrace knows about the -h flag."
7170 *** $me: Fatal Error: $dtrace doesn't support -h flag
7172 *** Your installed dtrace doesn't support the -h switch to compile a D
7173 *** program into a C header. Can't continue.
7185 *** $me: Fatal Error: $dtrace not found.
7192 echo "*** $dtrace was not found."
7198 : See if we want extra modules installed
7205 Perl can be built with extra modules or bundles of modules which
7206 will be fetched from the CPAN and installed alongside Perl.
7208 Notice that you will need access to the CPAN; either via the Internet,
7209 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7210 be asked later to configure the CPAN.pm module which will in turn do
7211 the installation of the rest of the extra modules or bundles.)
7213 Notice also that if the modules require any external software such as
7214 libraries and headers (the libz library and the zlib.h header for the
7215 Compress::Zlib module, for example) you MUST have any such software
7216 already installed, this configuration process will NOT install such
7219 If this doesn't make any sense to you, just accept the default '$dflt'.
7221 rp='Install any extra modules (y or n)?'
7227 Please list any extra modules or bundles to be installed from CPAN,
7228 with spaces between the names. The names can be in any format the
7229 'install' command of CPAN.pm will understand. (Answer 'none',
7230 without the quotes, to install no extra modules or bundles.)
7240 $rm -f ../extras.lst
7242 *) echo "(Saving the list of extras for later...)"
7243 echo "$extras" > ../extras.lst
7251 : determine where html pages for programs go
7252 set html1dir html1dir none
7256 If you wish to install html files for programs in $spackage, indicate
7257 the appropriate directory here. To skip installing html files,
7261 ''|none|$undef|' ') dflt=none ;;
7262 *) dflt=$html1dir ;;
7265 rp="Directory for the main $spackage html pages?"
7269 : Use ' ' for none so value is preserved next time through Configure
7270 $test X"$html1dir" = "X" && html1dir=' '
7272 : determine where html pages for libraries and modules go
7273 set html3dir html3dir none
7277 If you wish to install html files for modules associated with $spackage,
7278 indicate the appropriate directory here. To skip installing html files,
7281 : There is no obvious default. If they have specified html1dir, then
7282 : try to key off that, possibly changing .../html1 into .../html3.
7284 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7285 *) dflt=$html3dir ;;
7288 rp="Directory for the $spackage module html pages?"
7292 : Use ' ' for none so value is preserved next time through Configure
7293 $test X"$html3dir" = "X" && html3dir=' '
7295 : determine whether to install perl also as /usr/bin/perl
7298 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7300 Many scripts expect perl to be installed as /usr/bin/perl.
7302 If you want to, I can install the perl you are about to compile
7303 as /usr/bin/perl (in addition to $bin/perl).
7305 if test -f /usr/bin/perl; then
7308 However, please note that because you already have a /usr/bin/perl,
7309 overwriting that with a new Perl would very probably cause problems.
7310 Therefore I'm assuming you don't want to do that (unless you insist).
7313 case "$installusrbinperl" in
7314 "$define"|[yY]*) dflt='y';;
7320 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7323 case "$installusrbinperl" in
7324 "$undef"|[nN]*) dflt='n';;
7328 rp="Do you want to install perl as /usr/bin/perl?"
7331 [yY]*) val="$define";;
7337 set installusrbinperl
7340 : Check if we are using the GNU C library
7342 echo "Checking for GNU C Library..." >&4
7344 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7345 alone are insufficient to distinguish different versions, such as
7346 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7347 libc version 2.1.0. A. Dougherty, June 3, 2002.
7353 # ifdef __GLIBC_MINOR__
7354 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7355 # include <gnu/libc-version.h>
7356 printf("%s\n", gnu_get_libc_version());
7358 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7361 printf("%d\n", __GLIBC__);
7370 if eval $compile_ok && $run ./try > glibc.ver; then
7372 gnulibc_version=`$cat glibc.ver`
7373 echo "You are using the GNU C Library version $gnulibc_version"
7377 echo "You are not using the GNU C Library"
7383 : see if nm is to be used to determine whether a symbol is defined or not
7387 case "$d_gnulibc" in
7390 echo "nm probably won't work on the GNU C Library." >&4
7396 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7398 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7399 echo "'nm' won't be sufficient on this sytem." >&4
7405 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7406 if $test $dflt -gt 20; then
7416 true|$define) dflt=y;;
7423 I can use $nm to extract the symbols from your C libraries. This
7424 is a time consuming task which may generate huge output on the disk (up
7425 to 3 megabytes) but that should make the symbols extraction faster. The
7426 alternative is to skip the 'nm' extraction part and to compile a small
7427 test program instead to determine whether each symbol is present. If
7428 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7429 this may be the best solution.
7431 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7434 rp="Shall I use $nm to extract C symbols from the libraries?"
7437 [Nn]*) usenm=false;;
7446 : nm options which may be necessary
7448 '') if $test -f /mach_boot; then
7450 elif $test -d /usr/ccs/lib; then
7451 nm_opt='-p' # Solaris (and SunOS?)
7452 elif $test -f /dgux; then
7454 elif $test -f /lib64/rld; then
7455 nm_opt='-p' # 64-bit Irix
7461 : nm options which may be necessary for shared libraries but illegal
7462 : for archive libraries. Thank you, Linux.
7463 case "$nm_so_opt" in
7464 '') case "$myuname" in
7466 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7467 nm_so_opt='--dynamic'
7474 : Figure out where the libc is located
7477 : get list of predefined functions in a handy place
7482 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7488 *) for thislib in $libs; do
7491 : Handle C library specially below.
7494 thislib=`echo $thislib | $sed -e 's/^-l//'`
7495 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7497 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7499 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7501 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7503 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7505 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7507 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7512 libnames="$libnames $try"
7514 *) libnames="$libnames $thislib" ;;
7523 for xxx in $libpth; do
7524 $test -r $1 || set $xxx/libc.$so
7525 : The messy sed command sorts on library version numbers.
7527 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7528 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7530 s/[0-9][0-9]*/0000&/g
7531 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7534 $sort | $sed -e 's/^.* //'`
7537 $test -r $1 || set /usr/ccs/lib/libc.$so
7538 $test -r $1 || set /lib/libsys_s$_a
7544 if $test -r "$1"; then
7545 echo "Your (shared) C library seems to be in $1."
7547 elif $test -r /lib/libc && $test -r /lib/clib; then
7548 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7550 libc='/lib/clib /lib/libc'
7551 if $test -r /lib/syslib; then
7552 echo "(Your math library is in /lib/syslib.)"
7553 libc="$libc /lib/syslib"
7555 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7556 echo "Your C library seems to be in $libc, as you said before."
7557 elif $test -r $incpath/usr/lib/libc$_a; then
7558 libc=$incpath/usr/lib/libc$_a;
7559 echo "Your C library seems to be in $libc. That's fine."
7560 elif $test -r /lib/libc$_a; then
7562 echo "Your C library seems to be in $libc. You're normal."
7564 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7566 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7567 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7568 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7570 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7572 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7575 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7577 if $test -r "$tans"; then
7578 echo "Your C library seems to be in $tans, of all places."
7584 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7588 If the guess above is wrong (which it might be if you're using a strange
7589 compiler, or your machine supports multiple models), you can override it here.
7594 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7596 I can't seem to find your C library. I've looked in the following places:
7599 $sed 's/^/ /' libpath
7602 None of these seems to contain your C library. I need to get its name...
7607 rp='Where is your C library?'
7612 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7613 set X `cat libnames`
7616 case $# in 1) xxx=file; esac
7617 echo "Extracting names from the following $xxx for later perusal:" >&4
7619 $sed 's/^/ /' libnames >&4
7621 $echo $n "This may take a while...$c" >&4
7625 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7626 *) $nm $nm_opt $file 2>/dev/null;;
7631 $grep fprintf libc.tmp > libc.ptf
7632 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7633 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7635 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7639 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7641 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7643 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7645 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7647 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7649 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7651 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7653 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7655 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7657 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7659 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7660 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7664 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7668 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7670 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7672 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7674 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7676 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7678 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7680 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7682 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7684 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7686 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7688 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7690 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7693 $nm -p $* 2>/dev/null >libc.tmp
7694 $grep fprintf libc.tmp > libc.ptf
7695 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7696 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7702 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7704 if $ar t $libc > libc.tmp && \
7705 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7707 for thisname in $libnames $libc; do
7708 $ar t $thisname >>libc.tmp
7710 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7712 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7713 for thisname in $libnames $libc; do
7714 $ar tv $thisname >>libc.tmp
7715 emximp -o tmp.imp $thisname \
7717 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7718 < tmp.imp >>libc.tmp
7721 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7724 echo "$ar didn't seem to work right." >&4
7725 echo "Maybe this is a Cray...trying bld instead..." >&4
7727 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7730 for thisname in $libnames; do
7732 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7733 $ar t $thisname >>libc.tmp
7737 echo "That didn't work either. Giving up." >&4
7747 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7748 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7750 *) if $test -f /lib/syscalls.exp; then
7752 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7753 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7754 /lib/syscalls.exp >>libc.list
7760 $rm -f libnames libpath
7762 : see if dld is available
7766 : Check if we are using C++
7768 echo "Checking for C++..." >&4
7769 $cat >try.c <<'EOCP'
7781 if eval $compile_ok && $run ./try; then
7783 echo "You are using a C++ compiler."
7786 echo "You are not using a C++ compiler."
7792 : is a C symbol defined?
7795 -v) tf=libc.tmp; tdc="";;
7796 -a) tf=libc.tmp; tdc="[]";;
7797 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7799 case "$d_cplusplus" in
7800 $define) extern_C="extern \"C\"" ;;
7801 *) extern_C="extern" ;;
7804 case "$reuseval-$4" in
7806 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7811 if $test "$runnm" = true; then
7812 if $contains $tlook $tf >/dev/null 2>&1; then
7814 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7815 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7816 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7817 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7821 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7822 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7828 $define) tval=true;;
7835 : define an is-in-libc? function
7836 inlibc='echo " "; td=$define; tu=$undef;
7837 sym=$1; var=$2; eval "was=\$$2";
7839 case "$reuseval$was" in
7849 echo "$sym() found." >&4;
7850 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7852 echo "$sym() NOT found." >&4;
7853 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7857 $define) echo "$sym() found." >&4;;
7858 *) echo "$sym() NOT found." >&4;;
7862 : see if dlopen exists
7864 xxx_ccflags="$ccflags"
7866 : with g++ one needs -shared to get is-in-libc to work for dlopen
7867 case "$gccversion" in
7869 *) case "$d_cplusplus" in
7870 "$define") ccflags="$ccflags -shared" ;;
7877 ccflags="$xxx_ccflags"
7879 : see if this is a unistd.h system
7880 set unistd.h i_unistd
7883 : determine which dynamic loading, if any, to compile in
7885 dldir="ext/DynaLoader"
7898 $define) dflt='y' ;;
7901 $define) dflt='y' ;;
7903 : Does a dl_xxx.xs file exist for this operating system
7904 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7907 rp="Do you wish to use dynamic loading?"
7915 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7916 dflt="$dldir/dl_${osname}.xs"
7917 elif $test "$d_dlopen" = "$define" ; then
7918 dflt="$dldir/dl_dlopen.xs"
7919 elif $test "$i_dld" = "$define" ; then
7920 dflt="$dldir/dl_dld.xs"
7925 *) dflt="$dldir/$dlsrc"
7928 echo "The following dynamic loading files are available:"
7929 : Can not go over to $dldir because getfile has path hard-coded in.
7930 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7931 rp="Source file to use for dynamic loading"
7937 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7941 Some systems may require passing special flags to $cc -c to
7942 compile modules that will be used to create a shared library.
7943 To use no flags, say "none".
7946 case "$cccdlflags" in
7947 '') case "$gccversion" in
7948 '') case "$osname" in
7950 next) dflt='none' ;;
7951 irix*) dflt='-KPIC' ;;
7952 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7953 sunos) dflt='-pic' ;;
7957 *) case "$osname" in
7958 darwin) dflt='none' ;;
7959 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7964 *) dflt="$cccdlflags" ;;
7966 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7969 none) cccdlflags=' ' ;;
7970 *) cccdlflags="$ans" ;;
7975 Some systems use ld to create libraries that can be dynamically loaded,
7976 while other systems (such as those using ELF) use $cc.
7980 : Determine if this is ELF
7982 /* Test for whether ELF binaries are produced */
7994 int i = open("a.out",O_RDONLY);
7997 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7998 exit(0); /* succeed (yes, it is ELF) */
8003 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8009 '') if $test $bin_ELF = "$define"; then
8011 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8015 echo "I'll use ld to build dynamic libraries."
8023 rp="What command should be used to create dynamic libraries?"
8029 Some systems may require passing special flags to $ld to create a
8030 library that can be dynamically loaded. If your ld flags include
8031 -L/other/path options to locate libraries outside your loader's normal
8032 search path, you may need to specify those -L options here as well. To
8033 use no flags, say "none".
8036 case "$lddlflags" in
8037 '') case "$osname" in
8038 haiku) dflt='-shared' ;;
8040 case "$gccversion" in
8041 '') dflt="$dflt +vnocompatwarnings" ;;
8044 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8045 next) dflt='none' ;;
8046 solaris) dflt='-G' ;;
8047 sunos) dflt='-assert nodefinitions' ;;
8048 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8052 *) dflt="$lddlflags" ;;
8055 : Try to guess additional flags to pick up local libraries.
8056 : Be careful not to append to a plain 'none'
8060 for thisflag in $ldflags; do
8065 *) dflt="$dflt $thisflag" ;;
8072 ''|' ') dflt='none' ;;
8076 *-fstack-protector*)
8078 *-fstack-protector*) ;; # Don't add it again
8079 *) dflt="$dflt -fstack-protector" ;;
8085 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8088 none) lddlflags=' ' ;;
8089 *) lddlflags="$ans" ;;
8094 Some systems may require passing special flags to $cc to indicate that
8095 the resulting executable will use dynamic linking. To use no flags,
8099 case "$ccdlflags" in
8100 '') case "$osname" in
8101 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8102 next|sunos) dflt='none' ;;
8106 *) dflt="$ccdlflags" ;;
8108 rp="Any special flags to pass to $cc to use dynamic linking?"
8111 none) ccdlflags=' ' ;;
8112 *) ccdlflags="$ans" ;;
8123 ld_can_script="$undef"
8124 case "$bin_ELF$usedl" in
8126 # Abuse try.h and a.out names for neat cleanup
8138 if $cc $cccdlflags $ccdlflags $ccflags \
8139 $ldflags $lddlflags -o a.out try.c \
8140 -Wl,--version-script=try.h >/dev/null 2>&1 \
8141 && $test -s a.out ; then
8142 echo "ld supports scripting" >&4
8143 ld_can_script="$define"
8145 echo "ld does not support scripting" >&4
8151 : Do we want a shared libperl?
8155 # No dynamic loading being used, so don't bother even to prompt.
8158 *) case "$useshrplib" in
8159 '') case "$osname" in
8160 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8162 also='Building a shared libperl is required for dynamic loading to work on your system.'
8167 also='Building a shared libperl is needed for MAB support.'
8185 The perl executable is normally obtained by linking perlmain.c with
8186 libperl${_a}, any static extensions (usually just DynaLoader), and
8187 any other libraries needed on this system (such as -lm, etc.). Since
8188 your system supports dynamic loading, it is probably possible to build
8189 a shared libperl.$so. If you will have more than one executable linked
8190 to libperl.$so, this will significantly reduce the size of each
8191 executable, but it may have a noticeable effect on performance. The
8192 default is probably sensible for your system.
8196 rp="Build a shared libperl.$so (y/n)"
8200 useshrplib='true' ;;
8201 *) useshrplib='false' ;;
8206 case "$useshrplib" in
8208 case "$userelocatableinc" in
8210 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8211 echo "See INSTALL for an explanation why that won't work." >&4
8217 # Figure out a good name for libperl.so. Since it gets stored in
8218 # a version-specific architecture-dependent library, the version
8219 # number isn't really that important, except for making cc/ld happy.
8221 # A name such as libperl.so.10.1
8222 majmin="libperl.$so.$patchlevel.$subversion"
8223 # A name such as libperl.so.100
8224 majonly=`echo $patchlevel $subversion |
8225 $awk '{printf "%d%02d", $1, $2}'`
8226 majonly=libperl.$so.$majonly
8227 # I'd prefer to keep the os-specific stuff here to a minimum, and
8228 # rely on figuring it out from the naming of libc.
8229 case "${osname}${osvers}" in
8232 # XXX How handle the --version stuff for MAB?
8234 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8237 cygwin*) # ld links now against the dll directly
8238 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8239 majonly=`echo $patchlevel $subversion |
8240 $awk '{printf "%03d%03d", $1, $2}'`
8241 majonly=cygperl5.$majonly.$so
8244 *) # Try to guess based on whether libc has major.minor.
8246 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8247 *libc.$so.[0-9]*) dflt=$majonly ;;
8248 *) dflt=libperl.$so ;;
8258 I need to select a good name for the shared libperl. If your system uses
8259 library names with major and minor numbers, then you might want something
8260 like $majmin. Alternatively, if your system uses a single version
8261 number for shared libraries, then you might want to use $majonly.
8262 Or, your system might be quite happy with a simple libperl.$so.
8264 Since the shared libperl will get installed into a version-specific
8265 architecture-dependent directory, the version number of the shared perl
8266 library probably isn't important, so the default should be o.k.
8269 rp='What name do you want to give to the shared libperl?'
8272 echo "Ok, I'll use $libperl"
8275 libperl="libperl${_a}"
8279 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8283 WARNING: Use of the shrpdir variable for the installation location of
8284 the shared $libperl is not supported. It was never documented and
8285 will not work in this version. Let me (perlbug@perl.org)
8286 know of any problems this may cause.
8292 But your current setting of $shrpdir is
8293 the default anyway, so it's harmless.
8298 Further, your current attempted setting of $shrpdir
8299 conflicts with the value of $archlibexp/CORE
8300 that installperl will use.
8307 # How will the perl executable find the installed shared $libperl?
8308 # Add $xxx to ccdlflags.
8309 # If we can't figure out a command-line option, use $shrpenv to
8310 # set env LD_RUN_PATH. The main perl makefile uses this.
8311 shrpdir=$archlibexp/CORE
8314 if "$useshrplib"; then
8317 # We'll set it in Makefile.SH...
8322 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
8323 xxx="-Wl,-R$shrpdir"
8325 bsdos|linux|irix*|dec_osf|gnu*)
8326 xxx="-Wl,-rpath,$shrpdir"
8329 # next doesn't like the default...
8332 # Haiku doesn't like the default, either.
8335 # hpux doesn't like the default, either.
8336 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8339 # cygwin needs only ldlibpth
8342 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8348 # Only add $xxx if it isn't already in ccdlflags.
8349 case " $ccdlflags " in
8351 *) ccdlflags="$ccdlflags $xxx"
8354 Adding $xxx to the flags
8355 passed to $ld so that the perl executable will find the
8356 installed shared $libperl.
8364 # Fix ccdlflags in AIX for building external extensions.
8365 # (For building Perl itself bare -bE:perl.exp is needed,
8366 # Makefile.SH takes care of this.)
8368 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8370 # Respect a hint or command-line value.
8372 '') shrpenv="$tmp_shrpenv" ;;
8374 case "$ldlibpthname" in
8375 '') ldlibpthname=LD_LIBRARY_PATH ;;
8376 none) ldlibpthname='' ;;
8379 : determine where manual pages are on this system
8383 syspath='/usr/share/man/man1 /usr/man/man1'
8384 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8385 syspath="$syspath /usr/man/u_man/man1"
8386 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8387 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8388 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8389 sysman=`./loc . /usr/man/man1 $syspath`
8392 if $test -d "$sysman"; then
8393 echo "System manual is in $sysman." >&4
8395 echo "Could not find manual pages in source form." >&4
8398 : determine where manual pages go
8399 set man1dir man1dir none
8403 $spackage has manual pages available in source form.
8407 echo "However, you don't have nroff, so they're probably useless to you."
8409 '') man1dir="none";;
8412 echo "If you don't want the manual sources installed, answer 'none'."
8417 lookpath="$prefixexp/share/man/man1"
8418 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8419 lookpath="$lookpath $prefixexp/man/p_man/man1"
8420 lookpath="$lookpath $prefixexp/man/u_man/man1"
8421 lookpath="$lookpath $prefixexp/man/man.1"
8423 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8424 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8434 rp="Where do the main $spackage manual pages (source) go?"
8436 if $test "X$man1direxp" != "X$ansexp"; then
8447 : What suffix to use on installed man pages
8454 rp="What suffix should be used for the main $spackage man pages?"
8456 '') case "$man1dir" in
8470 *) dflt="$man1ext";;
8477 : see if we can have long filenames
8479 first=123456789abcdef
8481 if (echo hi >$first) 2>/dev/null; then
8482 if $test -f 123456789abcde; then
8483 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8486 echo 'You can have filenames longer than 14 characters.'>&4
8491 You can't have filenames longer than 14 chars.
8492 You can't even think about them!
8498 $rm -rf 123456789abcde*
8500 : determine where library module manual pages go
8501 set man3dir man3dir none
8505 $spackage has manual pages for many of the library modules.
8511 However, you don't have nroff, so they're probably useless to you.
8514 '') man3dir="none";;
8518 case "$d_flexfnam" in
8521 However, your system can't handle the long file names like File::Basename.3.
8524 '') man3dir="none";;
8528 echo "If you don't want the manual sources installed, answer 'none'."
8529 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8531 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8532 if $test -d "$privlib/man/man3"; then
8535 WARNING: Previous versions of perl installed man3 pages into
8536 $privlib/man/man3. This version will suggest a
8537 new default of $dflt.
8541 rp='Do you wish to preserve the old behavior?(y/n)'
8544 y*) dflt="$privlib/man/man3" ;;
8549 *) dflt="$man3dir" ;;
8556 rp="Where do the $package library man pages (source) go?"
8566 : What suffix to use on installed man pages
8572 rp="What suffix should be used for the $package library man pages?"
8574 '') case "$man3dir" in
8588 *) dflt="$man3ext";;
8595 : see if we have to deal with yellow pages, now NIS.
8596 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8597 if $test -f /usr/etc/nibindd; then
8599 echo "I'm fairly confident you're on a NeXT."
8601 rp='Do you get the hosts file via NetInfo?'
8610 y*) hostcat='nidump hosts .';;
8611 *) case "$hostcat" in
8612 nidump*) hostcat='';;
8622 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8630 rp='Are you getting the hosts file via yellow pages?'
8633 y*) hostcat='ypcat hosts';;
8634 *) hostcat='cat /etc/hosts';;
8640 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8643 '') test -f /etc/group && groupcat='cat /etc/group';;
8646 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8649 : now get the host name
8651 echo "Figuring out host name..." >&4
8652 case "$myhostname" in
8654 echo 'Maybe "hostname" will work...'
8655 if tans=`sh -c hostname 2>&1` ; then
8663 if $test "$cont"; then
8665 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8666 if tans=`cat /etc/systemid 2>&1` ; then
8668 phostname='cat /etc/systemid'
8669 echo "Whadyaknow. Xenix always was a bit strange..."
8672 elif $test -r /etc/systemid; then
8673 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8676 if $test "$cont"; then
8677 echo 'No, maybe "uuname -l" will work...'
8678 if tans=`sh -c 'uuname -l' 2>&1` ; then
8680 phostname='uuname -l'
8682 echo 'Strange. Maybe "uname -n" will work...'
8683 if tans=`sh -c 'uname -n' 2>&1` ; then
8685 phostname='uname -n'
8687 echo 'Oh well, maybe I can mine it out of whoami.h...'
8688 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8689 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8690 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8692 case "$myhostname" in
8693 '') echo "Does this machine have an identity crisis or something?"
8696 echo "Well, you said $myhostname before..."
8697 phostname='echo $myhostname';;
8703 case "$myhostname" in
8704 '') myhostname=noname ;;
8706 : you do not want to know about this
8711 if $test "$myhostname" ; then
8713 rp='Your host name appears to be "'$myhostname'".'" Right?"
8721 : bad guess or no guess
8722 while $test "X$myhostname" = X ; do
8724 rp="Please type the (one word) name of your host:"
8729 : translate upper to lower if necessary
8730 case "$myhostname" in
8732 echo "(Normalizing case in your host name)"
8733 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8737 case "$myhostname" in
8739 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8740 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8741 echo "(Trimming domain name from host name--host name is now $myhostname)"
8743 *) case "$mydomain" in
8746 test "X$hostcat" = "Xypcat hosts" &&
8747 ypmatch "$myhostname" hosts 2>/dev/null |\
8748 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8751 test "X$hostcat" != "X" &&
8752 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8753 /[ ]$myhostname[ . ]/p" > hosts
8756 if $test -f hosts; then
8757 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8758 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8759 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8760 hosts | $sort | $uniq | \
8761 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8762 case `$echo X$dflt` in
8763 X*\ *) echo "(Several hosts in the database matched hostname)"
8766 X.) echo "(You do not have fully-qualified names in the hosts database)"
8770 echo "(I cannot locate a hosts database anywhere)"
8775 tans=`./loc resolv.conf X /etc /usr/etc`
8776 if $test -f "$tans"; then
8777 echo "(Attempting domain name extraction from $tans)"
8778 dflt=.`$sed -n -e 's/ / /g' \
8779 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8782 .) dflt=.`$sed -n -e 's/ / /g' \
8783 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8791 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8792 dflt=.`sh -c domainname 2>/dev/null`
8795 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8799 case "$dflt$osname" in
8800 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8801 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8805 .) echo "(Lost all hope -- silly guess then)"
8811 *) dflt="$mydomain";;
8815 rp="What is your domain name?"
8825 : translate upper to lower if necessary
8828 echo "(Normalizing case in your domain name)"
8829 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8833 : a little sanity check here
8834 case "$phostname" in
8837 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8838 $myhostname$mydomain|$myhostname) ;;
8840 case "$phostname" in
8842 echo "(That doesn't agree with your whoami.h file, by the way.)"
8845 echo "(That doesn't agree with your $phostname command, by the way.)"
8853 : determine the e-mail address of the user who is running us
8856 I need to get your e-mail address in Internet format if possible, i.e.
8857 something like user@host.domain. Please answer accurately since I have
8858 no easy means to double check it. The default value provided below
8859 is most probably close to reality but may not be valid from outside
8860 your organization...
8864 while test "$cont"; do
8865 case "$MAILDOMAIN" in
8866 '') maildomain="$myhostname$mydomain";;
8867 *) maildomain="$MAILDOMAIN";;
8870 '') dflt="$cf_by@$maildomain";;
8871 *) dflt="$cf_email";;
8873 rp='What is your e-mail address?'
8879 rp='Address does not look like an Internet one. Use it anyway?'
8893 : Ask e-mail of administrator
8896 If you or somebody else will be maintaining perl at your site, please
8897 fill in the correct e-mail address here so that they may be contacted
8898 if necessary. Currently, the "perlbug" program included with perl
8899 will send mail to this address in addition to perlbug@perl.org. You may
8900 enter "none" for no administrator.
8903 case "$perladmin" in
8904 '') dflt="$cf_email";;
8905 *) dflt="$perladmin";;
8907 rp='Perl administrator e-mail address'
8911 : determine whether to only install version-specific parts.
8914 Do you want to install only the version-specific parts of the perl
8915 distribution? Usually you do *not* want to do this.
8917 case "$versiononly" in
8918 "$define"|[Yy]*|true) dflt='y' ;;
8921 rp="Do you want to install only the version-specific parts of perl?"
8924 [yY]*) val="$define";;
8930 case "$versiononly" in
8931 "$define") inc_version_list=''
8932 inc_version_list_init=0
8936 : figure out how to guarantee perl startup
8937 : XXX Note that this currently takes advantage of the bug that binexp ignores
8938 : the Configure -Dinstallprefix setting, which in turn means that under
8939 : relocatable @INC, initialinstalllocation is what binexp started as.
8940 case "$startperl" in
8942 case "$sharpbang" in
8946 I can use the #! construct to start perl on your system. This will
8947 make startup of perl scripts faster, but may cause problems if you
8948 want to share those scripts and perl is not in a standard place
8949 ($initialinstalllocation/perl) on all your platforms. The alternative
8950 is to force a shell by starting the script with a single ':' character.
8953 case "$versiononly" in
8954 "$define") dflt="$initialinstalllocation/perl$version";;
8955 *) dflt="$initialinstalllocation/perl";;
8957 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8960 none) startperl=": # use perl";;
8961 *) startperl="#!$ans"
8962 if $test 30 -lt `echo "$ans" | wc -c`; then
8965 WARNING: Some systems limit the #! command to 32 characters.
8966 If you experience difficulty running Perl scripts with #!, try
8967 installing Perl in a directory with a shorter pathname.
8973 *) startperl=": # use perl"
8978 echo "I'll use $startperl to start perl scripts."
8980 : figure best path for perl in scripts
8983 case "$versiononly" in
8984 "$define") perlpath="$initialinstalllocation/perl$version";;
8985 *) perlpath="$initialinstalllocation/perl";;
8987 case "$startperl" in
8992 I will use the "eval 'exec'" idiom to start Perl on your system.
8993 I can use the full path of your Perl binary for this purpose, but
8994 doing so may cause problems if you want to share those scripts and
8995 Perl is not always in a standard place ($initialinstalllocation/perl).
8998 dflt="$initialinstalllocation/perl"
8999 rp="What path shall I use in \"eval 'exec'\"?"
9006 case "$startperl" in
9008 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9011 : determine where public executable scripts go
9012 set scriptdir scriptdir
9014 case "$scriptdir" in
9017 : guess some guesses
9018 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9019 $test -d /usr/share/bin && dflt=/usr/share/bin
9020 $test -d /usr/local/script && dflt=/usr/local/script
9021 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9022 $test -d $prefixexp/script && dflt=$prefixexp/script
9026 *) dflt="$scriptdir"
9031 Some installations have a separate directory just for executable scripts so
9032 that they can mount it across multiple architectures but keep the scripts in
9033 one spot. You might, for example, have a subdirectory of /usr/share for this.
9034 Or you might just lump your scripts in with all your other executables.
9038 rp='Where do you keep publicly executable scripts?'
9040 if $test "X$ansexp" != "X$scriptdirexp"; then
9046 : A little fix up for an irregularly named variable.
9047 installscript="$installscriptdir"
9049 : determine where add-on public executables go
9051 '') dflt=$siteprefix/bin ;;
9055 rp='Pathname where the add-on public executables should be installed?'
9060 : determine where add-on html pages go
9061 : There is no standard location, so try to copy the previously-selected
9062 : directory structure for the core html pages.
9063 case "$sitehtml1dir" in
9064 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9065 *) dflt=$sitehtml1dir ;;
9068 ''|' ') dflt=none ;;
9071 rp='Pathname where the site-specific html pages should be installed?'
9073 prefixvar=sitehtml1dir
9076 : determine where add-on library html pages go
9077 : There is no standard location, so try to copy the previously-selected
9078 : directory structure for the core html pages.
9079 case "$sitehtml3dir" in
9080 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9081 *) dflt=$sitehtml3dir ;;
9084 ''|' ') dflt=none ;;
9087 rp='Pathname where the site-specific library html pages should be installed?'
9089 prefixvar=sitehtml3dir
9092 : determine where add-on manual pages go
9093 case "$siteman1dir" in
9094 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9095 *) dflt=$siteman1dir ;;
9098 ''|' ') dflt=none ;;
9101 rp='Pathname where the site-specific manual pages should be installed?'
9103 prefixvar=siteman1dir
9106 : determine where add-on library man pages go
9107 case "$siteman3dir" in
9108 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9109 *) dflt=$siteman3dir ;;
9112 ''|' ') dflt=none ;;
9115 rp='Pathname where the site-specific library manual pages should be installed?'
9117 prefixvar=siteman3dir
9120 : determine where add-on public executable scripts go
9121 case "$sitescript" in
9122 '') dflt=$siteprefix/script
9123 $test -d $dflt || dflt=$sitebin ;;
9124 *) dflt="$sitescript" ;;
9127 rp='Pathname where add-on public executable scripts should be installed?'
9129 prefixvar=sitescript
9132 : Check if faststdio is requested and available
9133 case "$usefaststdio" in
9134 $define|true|[yY]*|'')
9135 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9145 Perl can be built to use 'fast stdio', which means using the stdio
9146 library but also directly manipulating the stdio buffers to enable
9147 faster I/O. Using stdio is better for backward compatibility (especially
9148 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9149 interface has been preferred instead of stdio.
9151 If this doesn't make any sense to you, just accept the default '$dflt'.
9153 rp='Use the "fast stdio" if available?'
9156 y|Y) val="$define" ;;
9163 : define an is-a-typedef? function
9164 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9166 "") inclist="sys/types.h";;
9168 eval "varval=\$$var";
9172 for inc in $inclist; do
9173 echo "#include <$inc>" >>temp.c;
9175 echo "#ifdef $type" >> temp.c;
9176 echo "printf(\"We have $type\");" >> temp.c;
9177 echo "#endif" >> temp.c;
9178 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9179 if $contains $type temp.E >/dev/null 2>&1; then
9185 *) eval "$var=\$varval";;
9188 : define an is-a-typedef? function that prompts if the type is not available.
9189 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9191 "") inclist="sys/types.h";;
9193 eval "varval=\$$var";
9197 for inc in $inclist; do
9198 echo "#include <$inc>" >>temp.c;
9200 echo "#ifdef $type" >> temp.c;
9201 echo "printf(\"We have $type\");" >> temp.c;
9202 echo "#endif" >> temp.c;
9203 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9205 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9206 if $contains $type temp.E >/dev/null 2>&1; then
9207 echo "$type found." >&4;
9210 echo "$type NOT found." >&4;
9216 *) eval "$var=\$varval";;
9219 : see what type lseek is declared as in the kernel
9220 rp="What is the type used for lseek's offset on this system?"
9221 set off_t lseektype long stdio.h sys/types.h
9225 echo "Checking to see how big your file offsets are..." >&4
9227 #include <sys/types.h>
9231 printf("%d\n", (int)sizeof($lseektype));
9236 if eval $compile_ok; then
9237 lseeksize=`$run ./try`
9238 echo "Your file offsets are $lseeksize bytes long."
9242 echo "(I can't seem to compile the test program. Guessing...)"
9243 rp="What is the size of your file offsets (in bytes)?"
9249 : see what type file positions are declared as in the library
9250 rp="What is the type for file position used by fsetpos()?"
9251 set fpos_t fpostype long stdio.h sys/types.h
9254 : Check size for Fpos_t
9257 *_t) zzz="$fpostype" ;;
9260 echo "Checking the size of $zzz..." >&4
9262 #include <sys/types.h>
9269 printf("%d\n", (int)sizeof($fpostype));
9274 if eval $compile_ok; then
9278 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9281 echo "Your $zzz is $fpossize bytes long."
9287 echo "(I can't compile the test program. Guessing...)" >&4
9288 rp="What is the size of your file positions (in bytes)?"
9293 : Check for large file support
9294 # Backward compatibility (uselfs is deprecated).
9296 "$define"|true|[yY]*)
9299 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9301 uselargefiles="$define"
9305 case "$lseeksize:$fpossize" in
9308 You can have files larger than 2 gigabytes.
9311 *) case "$uselargefiles" in
9312 "$undef"|false|[nN]*) dflt='n' ;;
9317 Perl can be built to understand large files (files larger than 2 gigabytes)
9318 on some systems. To do so, Configure can be run with -Duselargefiles.
9320 If this doesn't make any sense to you, just accept the default '$dflt'.
9322 rp='Try to understand large files, if available?'
9325 y|Y) val="$define" ;;
9332 : Look for a hint-file generated 'call-back-unit'. If the
9333 : user has specified that a large files perl is to be built,
9334 : we may need to set or change some other defaults.
9335 if $test -f uselargefiles.cbu; then
9336 echo "Your platform has some specific hints regarding large file builds, using them..."
9337 . ./uselargefiles.cbu
9339 case "$uselargefiles" in
9341 if $test -f uselargefiles.cbu; then
9343 echo "Rechecking to see how big your file offsets are..." >&4
9345 #include <sys/types.h>
9349 printf("%d\n", (int)sizeof($lseektype));
9354 if eval $compile_ok; then
9355 lseeksize=`$run ./try`
9356 $echo "Your file offsets are now $lseeksize bytes long."
9360 echo "(I can't seem to compile the test program. Guessing...)"
9361 rp="What is the size of your file offsets (in bytes)?"
9366 *_t) zzz="$fpostype" ;;
9369 $echo $n "Rechecking the size of $zzz...$c" >&4
9371 #include <sys/types.h>
9378 printf("%d\n", (int)sizeof($fpostype));
9383 if eval $compile_ok; then
9388 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9391 echo " $fpossize bytes." >&4
9397 echo "(I can't compile the test program. Guessing...)" >&4
9398 rp="What is the size of your file positions (in bytes)?"
9407 : Check if we want perlio
9410 : Set the vendorbin variables
9411 case "$vendorprefix" in
9412 '') d_vendorbin="$undef"
9416 *) d_vendorbin="$define"
9417 : determine where vendor-supplied executables go.
9418 case "$vendorbin" in
9419 '') dflt=$vendorprefix/bin ;;
9420 *) dflt="$vendorbin" ;;
9423 rp='Pathname for the vendor-supplied executables directory?'
9426 vendorbinexp="$ansexp"
9432 : Set the vendorhtml1dir variables
9433 case "$vendorprefix" in
9434 '') vendorhtml1dir=''
9435 vendorhtml1direxp=''
9437 *) : determine where vendor-supplied html pages go.
9438 : There is no standard location, so try to copy the previously-selected
9439 : directory structure for the core html pages.
9440 : XXX Better default suggestions would be welcome.
9441 case "$vendorhtml1dir" in
9442 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9443 *) dflt=$vendorhtml1dir ;;
9446 ''|' ') dflt=none ;;
9449 rp='Pathname for the vendor-supplied html pages?'
9451 vendorhtml1dir="$ans"
9452 vendorhtml1direxp="$ansexp"
9455 : Use ' ' for none so value is preserved next time through Configure
9456 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9457 prefixvar=vendorhtml1dir
9460 : Set the vendorhtml3dir variables
9461 case "$vendorprefix" in
9462 '') vendorhtml3dir=''
9463 vendorhtml3direxp=''
9465 *) : determine where vendor-supplied module html pages go.
9466 : There is no standard location, so try to copy the previously-selected
9467 : directory structure for the core html pages.
9468 : XXX Better default suggestions would be welcome.
9469 case "$vendorhtml3dir" in
9470 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9471 *) dflt=$vendorhtml3dir ;;
9474 ''|' ') dflt=none ;;
9477 rp='Pathname for the vendor-supplied html pages?'
9479 vendorhtml3dir="$ans"
9480 vendorhtml3direxp="$ansexp"
9483 : Use ' ' for none so value is preserved next time through Configure
9484 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9485 prefixvar=vendorhtml3dir
9488 : Set the vendorman1dir variables
9489 case "$vendorprefix" in
9490 '') vendorman1dir=''
9493 *) : determine where vendor-supplied manual pages go.
9494 case "$vendorman1dir" in
9495 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9496 *) dflt=$vendorman1dir ;;
9499 ''|' ') dflt=none ;;
9502 rp='Pathname for the vendor-supplied manual section 1 pages?'
9504 vendorman1dir="$ans"
9505 vendorman1direxp="$ansexp"
9508 : Use ' ' for none so value is preserved next time through Configure
9509 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9510 prefixvar=vendorman1dir
9513 : Set the vendorman3dir variables
9514 case "$vendorprefix" in
9515 '') vendorman3dir=''
9518 *) : determine where vendor-supplied module manual pages go.
9519 case "$vendorman3dir" in
9520 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9521 *) dflt=$vendorman3dir ;;
9524 ''|' ') dflt=none ;;
9527 rp='Pathname for the vendor-supplied manual section 3 pages?'
9529 vendorman3dir="$ans"
9530 vendorman3direxp="$ansexp"
9533 : Use ' ' for none so value is preserved next time through Configure
9534 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9535 prefixvar=vendorman3dir
9538 : Set the vendorscript variables
9539 case "$vendorprefix" in
9540 '') d_vendorscript="$undef"
9544 *) d_vendorscript="$define"
9545 : determine where vendor-supplied scripts go.
9546 case "$vendorscript" in
9547 '') dflt=$vendorprefix/script
9548 $test -d $dflt || dflt=$vendorbin ;;
9549 *) dflt="$vendorscript" ;;
9553 The installation process will create a directory for
9554 vendor-supplied scripts.
9558 rp='Pathname for the vendor-supplied scripts directory?'
9561 vendorscriptexp="$ansexp"
9564 prefixvar=vendorscript
9567 : script used to emit important warnings
9570 if test \$# -gt 0; then
9575 echo "*** WARNING:" >&4
9576 sed -e 's/^/*** /' <msg >&4
9578 cat msg >>config.msg
9579 echo " " >>config.msg
9585 : see which of string.h or strings.h is needed
9587 strings=`./findhdr string.h`
9588 if $test "$strings" && $test -r "$strings"; then
9589 echo "Using <string.h> instead of <strings.h>." >&4
9593 strings=`./findhdr strings.h`
9594 if $test "$strings" && $test -r "$strings"; then
9595 echo "Using <strings.h> instead of <string.h>." >&4
9597 ./warn "No string header found -- You'll surely have problems."
9603 "$undef") strings=`./findhdr strings.h`;;
9604 *) strings=`./findhdr string.h`;;
9607 : see if qgcvt exists
9611 : Check print/scan long double stuff
9614 if $test X"$d_longdbl" = X"$define"; then
9616 echo "Checking how to print long doubles..." >&4
9618 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9619 $cat >try.c <<'EOCP'
9620 #include <sys/types.h>
9624 printf("%.3f\n", d);
9628 if eval $compile; then
9632 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9633 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9634 echo "We will use %f."
9640 if $test X"$sPRIfldbl" = X; then
9641 $cat >try.c <<'EOCP'
9642 #include <sys/types.h>
9645 long double d = 123.456;
9646 printf("%.3Lf\n", d);
9650 if eval $compile; then
9654 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9655 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9656 echo "We will use %Lf."
9662 if $test X"$sPRIfldbl" = X; then
9663 $cat >try.c <<'EOCP'
9664 #include <sys/types.h>
9667 long double d = 123.456;
9668 printf("%.3llf\n", d);
9672 if eval $compile; then
9676 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9677 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9678 echo "We will use %llf."
9684 if $test X"$sPRIfldbl" = X; then
9685 $cat >try.c <<'EOCP'
9686 #include <sys/types.h>
9689 long double d = 123.456;
9690 printf("%.3lf\n", d);
9694 if eval $compile; then
9698 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9699 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9700 echo "We will use %lf."
9706 if $test X"$sPRIfldbl" = X; then
9707 echo "Cannot figure out how to print long doubles." >&4
9709 sSCNfldbl=$sPRIfldbl # expect consistency
9716 case "$sPRIfldbl" in
9717 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9718 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9719 d_SCNfldbl="$undef";
9721 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9722 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9723 d_SCNfldbl="$define";
9727 : Check how to convert floats to strings.
9729 if test "X$d_Gconvert" = X; then
9732 echo "Checking for an efficient way to convert floats to strings."
9734 case "$uselongdouble" in
9735 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9737 case "$d_longdbl" in
9738 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9740 case "$d_PRIgldbl" in
9741 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9745 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9746 char *myname = "gconvert";
9749 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9750 char *myname = "gcvt";
9753 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9754 char *myname = "qgcvt";
9755 #define DOUBLETYPE long double
9758 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9760 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9762 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9765 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9767 char *myname = "sprintf";
9771 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9772 #define DOUBLETYPE long double
9774 #define DOUBLETYPE double
9786 # include <string.h>
9788 # include <strings.h>
9791 int checkit(char *expect, char *got)
9793 if (strcmp(expect, got)) {
9794 printf("%s oddity: Expected %s, got %s\n",
9795 myname, expect, got);
9805 /* This must be 1st test on (which?) platform */
9806 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9807 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9808 checkit("0.1", buf);
9810 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9811 checkit("0.01", buf);
9813 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9814 checkit("0.001", buf);
9816 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9817 checkit("0.0001", buf);
9819 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9820 if (strlen(buf) > 5)
9821 checkit("9e-005", buf); /* for Microsoft ?? */
9823 checkit("9e-05", buf);
9825 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9828 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9829 checkit("1.1", buf);
9831 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9832 checkit("1.01", buf);
9834 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9835 checkit("1.001", buf);
9837 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9838 checkit("1.0001", buf);
9840 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9841 checkit("1.00001", buf);
9843 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9844 checkit("1.000001", buf);
9846 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9849 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9852 /* Some Linux gcvt's give 1.e+5 here. */
9853 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9854 checkit("100000", buf);
9856 /* Some Linux gcvt's give -1.e+5 here. */
9857 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9858 checkit("-100000", buf);
9860 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9861 checkit("123.456", buf);
9863 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9864 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9865 /* 34 should be enough to scare even long double
9866 * places into using the e notation. */
9867 if (strlen(buf) > 5)
9868 checkit("1e+034", buf); /* for Microsoft */
9870 checkit("1e+34", buf);
9872 /* For Perl, if you add additional tests here, also add them to
9873 * t/base/num.t for benefit of platforms not using Configure or
9874 * overriding d_Gconvert */
9879 : first add preferred functions to our list
9881 for xxx_convert in $gconvert_preference; do
9882 case $xxx_convert in
9883 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9884 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9887 : then add any others
9888 for xxx_convert in gconvert gcvt sprintf; do
9891 *) xxx_list="$xxx_list $xxx_convert" ;;
9895 case "$d_longdbl$uselongdouble" in
9897 : again, add preferred functions to our list first
9899 for xxx_convert in $gconvert_ld_preference; do
9900 case $xxx_convert in
9901 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9902 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9905 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9906 for xxx_convert in qgcvt sprintf $xxx_list; do
9907 case "$xxx_ld_list" in
9908 $xxx_convert*|*" $xxx_convert"*) ;;
9909 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9912 : if sprintf cannot do long doubles, move it to the end
9913 if test "$d_PRIgldbl" != "$define"; then
9914 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9916 : if no qgcvt, remove it
9917 if test "$d_qgcvt" != "$define"; then
9918 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9921 xxx_list="$xxx_ld_list"
9925 for xxx_convert in $xxx_list; do
9926 echo "Trying $xxx_convert..."
9927 $rm -f try try$_o core
9928 set try -DTRY_$xxx_convert
9929 if eval $compile; then
9930 echo "$xxx_convert() found." >&4
9932 echo "I'll use $xxx_convert to convert floats into a string." >&4
9935 echo "...But $xxx_convert didn't work as I expected."
9939 echo "$xxx_convert NOT found." >&4
9943 if test X$xxx_convert = X; then
9944 echo "*** WHOA THERE!!! ***" >&4
9945 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9949 case "$xxx_convert" in
9950 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9951 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9952 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9953 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9954 "$define$define$define")
9955 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9956 "$define$define$undef")
9957 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9958 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9966 : see if _fwalk exists
9970 : Initialize h_fcntl
9973 : Initialize h_sysfile
9976 : access call always available on UNIX
9980 : locate the flags for 'access()'
9984 $cat >access.c <<EOCP
9985 #include <sys/types.h>
9990 #include <sys/file.h>
10003 : check sys/file.h first, no particular reason here
10004 if $test `./findhdr sys/file.h` && \
10005 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10007 echo "<sys/file.h> defines the *_OK access constants." >&4
10008 elif $test `./findhdr fcntl.h` && \
10009 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10011 echo "<fcntl.h> defines the *_OK access constants." >&4
10012 elif $test `./findhdr unistd.h` && \
10013 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10014 echo "<unistd.h> defines the *_OK access constants." >&4
10016 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10022 : see if accessx exists
10023 set accessx d_accessx
10026 : see if aintl exists
10030 : see if alarm exists
10034 : see if 64bit time functions exists
10036 set ctime64 d_ctime64
10039 set localtime64 d_localtime64
10042 set gmtime64 d_gmtime64
10045 set mktime64 d_mktime64
10048 set difftime64 d_difftime64
10051 set asctime64 d_asctime64
10054 : see if POSIX threads are available
10055 set pthread.h i_pthread
10058 : define a function to check prototypes
10059 $cat > protochk <<EOSH
10062 optimize="$optimize"
10064 prototype="$prototype"
10067 usethreads=$usethreads
10068 i_pthread=$i_pthread
10069 pthread_h_first=$pthread_h_first
10072 $cat >> protochk <<'EOSH'
10077 while test $# -ge 2; do
10079 $define) echo "#include <$2>" >> try.c ;;
10080 literal) echo "$2" >> try.c ;;
10082 # Extra magic for the benefit of systems that need pthread.h
10083 # to be included early to correctly detect threadsafe functions.
10084 # Such functions must guarantee themselves, though, that the usethreads
10085 # and i_pthread have been defined, before calling protochk.
10086 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10087 echo "#include <pthread.h>" >> try.c
10092 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10093 cat >> try.c <<'EOCP'
10094 #ifdef CAN_PROTOTYPE
10095 #define _(args) args
10100 echo "$foo" >> try.c
10101 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10102 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10108 $eunicefix protochk
10110 : Define hasproto macro for Configure internal use
10111 hasproto='varname=$1; func=$2; shift; shift;
10112 while $test $# -ge 2; do
10114 $define) echo "#include <$2>";;
10118 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10119 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10120 echo "$func() prototype found.";
10123 echo "$func() prototype NOT found.";
10130 : see if sys/types.h has to be included
10131 set sys/types.h i_systypes
10134 : see if sys/select.h has to be included
10135 set sys/select.h i_sysselct
10138 : Define hasfield macro for Configure internal use
10139 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10140 while $test $# -ge 2; do
10142 $define) echo "#include <$2>";;
10146 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10148 if eval $compile; then
10157 : see if we should include time.h, sys/time.h, or both
10159 if test "X$timeincl" = X; then
10160 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10161 $echo $n "I'm now running the test program...$c"
10163 #include <sys/types.h>
10168 #ifdef SYSTIMEKERNEL
10171 #include <sys/time.h>
10174 #include <sys/select.h>
10176 #$i_stdlib I_STDLIB
10178 #include <stdlib.h>
10184 struct timeval bar;
10187 struct timezone tzp;
10189 if (foo.tm_sec == foo.tm_sec)
10192 if (bar.tv_sec == bar.tv_sec)
10199 for s_timezone in '-DS_TIMEZONE' ''; do
10201 for s_timeval in '-DS_TIMEVAL' ''; do
10202 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10203 for i_time in '' '-DI_TIME'; do
10204 for i_systime in '-DI_SYSTIME' ''; do
10207 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10208 if eval $compile; then
10209 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10213 $echo $n "Succeeded with $flags$c"
10225 *SYSTIMEKERNEL*) i_systimek="$define"
10226 timeincl=`./findhdr sys/time.h`
10227 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10228 *) i_systimek="$undef";;
10231 *I_TIME*) i_time="$define"
10232 timeincl=`./findhdr time.h`" $timeincl"
10233 echo "We'll include <time.h>." >&4;;
10234 *) i_time="$undef";;
10237 *I_SYSTIME*) i_systime="$define"
10238 timeincl=`./findhdr sys/time.h`" $timeincl"
10239 echo "We'll include <sys/time.h>." >&4;;
10240 *) i_systime="$undef";;
10244 : see if struct tm knows about tm_zone
10245 case "$i_systime$i_time" in
10248 echo "Checking to see if your struct tm has tm_zone field..." >&4
10249 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10257 case "$d_tm_tm_zone" in
10258 "$define") echo "Yes, it does." ;;
10259 *) echo "No, it doesn't." ;;
10261 : see if struct tm knows about tm_gmtoff
10262 case "$i_systime$i_time" in
10265 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10266 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10274 case "$d_tm_tm_gmtoff" in
10275 "$define") echo "Yes, it does." ;;
10276 *) echo "No, it doesn't." ;;
10279 : see if asctime_r exists
10280 set asctime_r d_asctime_r
10282 case "$d_asctime_r" in
10284 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10285 case "$d_asctime_r_proto:$usethreads" in
10286 ":define") d_asctime_r_proto=define
10287 set d_asctime_r_proto asctime_r $hdrs
10291 case "$d_asctime_r_proto" in
10293 case "$asctime_r_proto" in
10294 ''|0) try='char* asctime_r(const struct tm*, char*);'
10295 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10297 case "$asctime_r_proto" in
10298 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10299 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10301 case "$asctime_r_proto" in
10302 ''|0) try='int asctime_r(const struct tm*, char*);'
10303 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10305 case "$asctime_r_proto" in
10306 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10307 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10309 case "$asctime_r_proto" in
10310 ''|0) d_asctime_r=undef
10312 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10313 * ) case "$asctime_r_proto" in
10314 REENTRANT_PROTO*) ;;
10315 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10317 echo "Prototype: $try" ;;
10320 *) case "$usethreads" in
10321 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10328 *) asctime_r_proto=0
10332 : see if atolf exists
10336 : see if atoll exists
10340 : Look for GCC-style attribute format
10341 case "$d_attribute_format" in
10344 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10345 $cat >attrib.c <<'EOCP'
10347 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10349 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10350 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10351 echo "Your C compiler doesn't support __attribute__((format))."
10354 echo "Your C compiler supports __attribute__((format))."
10358 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10362 *) val="$d_attribute_format" ;;
10364 set d_attribute_format
10368 : Look for GCC-style attribute format with null format allowed
10369 case "$d_printf_format_null" in
10370 '') case "$d_attribute_format" in
10373 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10374 $cat >attrib.c <<EOCP
10376 #$i_stdlib I_STDLIB
10378 #include <stdlib.h>
10380 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10381 int null_printf (char* pat,...) { return (int)pat; }
10382 int main () { exit(null_printf(NULL)); }
10384 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10385 : run the executable in case it produces a run-time warning
10386 if $run ./attrib >>attrib.out 2>&1; then
10387 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10388 echo "Your C compiler doesn't allow __printf__ format to be null."
10391 echo "Your C compiler allows __printf__ format to be null."
10395 echo "Your C compiler executable failed with __printf__ format null."
10399 echo "Your C compiler fails with __printf__ format null."
10406 *) val="$d_printf_format_null" ;;
10408 set d_printf_format_null
10412 : Look for GCC-style attribute malloc
10413 case "$d_attribute_malloc" in
10416 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10417 $cat >attrib.c <<'EOCP'
10419 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10421 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10422 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10423 echo "Your C compiler doesn't support __attribute__((malloc))."
10426 echo "Your C compiler supports __attribute__((malloc))."
10430 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10434 *) val="$d_attribute_malloc" ;;
10436 set d_attribute_malloc
10440 : Look for GCC-style attribute nonnull
10441 case "$d_attribute_nonnull" in
10444 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10445 $cat >attrib.c <<'EOCP'
10447 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10449 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10450 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10451 echo "Your C compiler doesn't support __attribute__((nonnull))."
10454 echo "Your C compiler supports __attribute__((nonnull))."
10458 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10462 *) val="$d_attribute_nonnull" ;;
10464 set d_attribute_nonnull
10468 : Look for GCC-style attribute noreturn
10469 case "$d_attribute_noreturn" in
10472 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10473 $cat >attrib.c <<'EOCP'
10475 void fall_over_dead( void ) __attribute__((noreturn));
10477 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10478 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10479 echo "Your C compiler doesn't support __attribute__((noreturn))."
10482 echo "Your C compiler supports __attribute__((noreturn))."
10486 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10490 *) val="$d_attribute_noreturn" ;;
10492 set d_attribute_noreturn
10496 : Look for GCC-style attribute pure
10497 case "$d_attribute_pure" in
10500 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10501 $cat >attrib.c <<'EOCP'
10503 int square( int n ) __attribute__((pure));
10505 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10506 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10507 echo "Your C compiler doesn't support __attribute__((pure))."
10510 echo "Your C compiler supports __attribute__((pure))."
10514 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10518 *) val="$d_attribute_pure" ;;
10520 set d_attribute_pure
10524 : Look for GCC-style attribute unused
10525 case "$d_attribute_unused" in
10528 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10529 $cat >attrib.c <<'EOCP'
10531 int do_something( int dummy __attribute__((unused)), int n );
10533 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10534 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10535 echo "Your C compiler doesn't support __attribute__((unused))."
10538 echo "Your C compiler supports __attribute__((unused))."
10542 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10546 *) val="$d_attribute_unused" ;;
10548 set d_attribute_unused
10552 : Look for GCC-style attribute deprecated
10553 case "$d_attribute_deprecated" in
10556 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10557 $cat >attrib.c <<'EOCP'
10559 int I_am_deprecated(void) __attribute__((deprecated));
10561 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10562 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10563 echo "Your C compiler doesn't support __attribute__((deprecated))."
10566 echo "Your C compiler supports __attribute__((deprecated))."
10570 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10574 *) val="$d_attribute_deprecated" ;;
10576 set d_attribute_deprecated
10580 : Look for GCC-style attribute warn_unused_result
10581 case "$d_attribute_warn_unused_result" in
10584 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10585 $cat >attrib.c <<'EOCP'
10587 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10589 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10590 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10591 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10594 echo "Your C compiler supports __attribute__((warn_unused_result))."
10598 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10602 *) val="$d_attribute_warn_unused_result" ;;
10604 set d_attribute_warn_unused_result
10608 : see if bcmp exists
10612 : see if bcopy exists
10616 : see if getpgrp exists
10617 set getpgrp d_getpgrp
10620 case "$d_getpgrp" in
10623 echo "Checking to see which flavor of getpgrp is in use..."
10625 #$i_unistd I_UNISTD
10626 #include <sys/types.h>
10628 # include <unistd.h>
10630 #$i_stdlib I_STDLIB
10632 #include <stdlib.h>
10636 if (getuid() == 0) {
10637 printf("(I see you are running Configure as super-user...)\n");
10640 #ifdef TRY_BSD_PGRP
10641 if (getpgrp(1) == 0)
10650 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10651 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10653 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10654 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10657 echo "I can't seem to compile and run the test program."
10659 xxx="a USG one, i.e. you use getpgrp()."
10661 # SVR4 systems can appear rather BSD-ish.
10662 case "$i_unistd" in
10664 xxx="a BSD one, i.e. you use getpgrp(pid)."
10668 xxx="probably a USG one, i.e. you use getpgrp()."
10673 echo "Assuming your getpgrp is $xxx" >&4
10682 : see if setpgrp exists
10683 set setpgrp d_setpgrp
10686 case "$d_setpgrp" in
10689 echo "Checking to see which flavor of setpgrp is in use..."
10691 #$i_unistd I_UNISTD
10692 #include <sys/types.h>
10694 # include <unistd.h>
10696 #$i_stdlib I_STDLIB
10698 #include <stdlib.h>
10702 if (getuid() == 0) {
10703 printf("(I see you are running Configure as super-user...)\n");
10706 #ifdef TRY_BSD_PGRP
10707 if (-1 == setpgrp(1, 1))
10710 if (setpgrp() != -1)
10716 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10717 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10719 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10720 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10723 echo "(I can't seem to compile and run the test program.)"
10725 xxx="a USG one, i.e. you use setpgrp()."
10727 # SVR4 systems can appear rather BSD-ish.
10728 case "$i_unistd" in
10730 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10734 xxx="probably a USG one, i.e. you use setpgrp()."
10739 echo "Assuming your setpgrp is $xxx" >&4
10748 : Look for GCC-style __builtin_choose_expr
10749 case "$d_builtin_choose_expr" in
10752 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10753 $cat >try.c <<'EOCP'
10754 #include <assert.h>
10755 #include <stdlib.h>
10758 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10761 assert( SYRINX(1) == 2112 );
10762 assert( SYRINX(1) != 5150 );
10763 assert( SYRINX(0) == 5150 );
10764 assert( SYRINX(0) != 2112 );
10765 puts( "All good!" );
10771 if eval $compile && $run ./try; then
10772 echo "Your C compiler supports __builtin_choose_expr."
10775 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10779 *) val="$d_builtin_choose_expr" ;;
10782 set d_builtin_choose_expr
10786 : Look for GCC-style __builtin_expect
10787 case "$d_builtin_expect" in
10790 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10791 $cat >try.c <<'EOCP'
10794 if ( __builtin_expect(n, 0) ) n = 1;
10795 /* Remember shell exit code truth is 0, C truth is non-zero */
10800 if eval $compile && $run ./try; then
10801 echo "Your C compiler supports __builtin_expect."
10804 echo "Your C compiler doesn't seem to understand __builtin_expect."
10808 *) val="$d_builtin_expect" ;;
10811 set d_builtin_expect
10815 : see if bzero exists
10819 : see if stdarg is available
10821 if $test `./findhdr stdarg.h`; then
10822 echo "<stdarg.h> found." >&4
10825 echo "<stdarg.h> NOT found." >&4
10829 : see if varags is available
10831 if $test `./findhdr varargs.h`; then
10832 echo "<varargs.h> found." >&4
10834 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10837 : set up the varargs testing programs
10838 $cat > varargs.c <<EOP
10840 #include <stdarg.h>
10843 #include <varargs.h>
10847 int f(char *p, ...)
10861 p = va_arg(ap, char *);
10867 $cat > varargs <<EOP
10869 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10878 : now check which varargs header should be included
10883 if `./varargs I_STDARG`; then
10885 elif `./varargs I_VARARGS`; then
10890 if `./varargs I_VARARGS`; then
10897 echo "I could not find the definition for va_dcl... You have problems..." >&4
10898 val="$undef"; set i_stdarg; eval $setvar
10899 val="$undef"; set i_varargs; eval $setvar
10904 case "$i_varhdr" in
10906 val="$define"; set i_stdarg; eval $setvar
10907 val="$undef"; set i_varargs; eval $setvar
10910 val="$undef"; set i_stdarg; eval $setvar
10911 val="$define"; set i_varargs; eval $setvar
10914 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10918 : see if the Compiler supports C99 variadic macros
10919 case "$i_stdarg$i_stdlib" in
10921 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10924 #include <stdarg.h>
10926 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10930 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10936 if eval $compile && $run ./try 2>&1 >/dev/null; then
10937 case "`$run ./try`" in
10939 echo "You have C99 variadic macros." >&4
10940 d_c99_variadic_macros="$define"
10943 echo "You don't have functional C99 variadic macros." >&4
10944 d_c99_variadic_macros="$undef"
10948 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10949 d_c99_variadic_macros="$undef"
10954 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10955 d_c99_variadic_macros="$undef"
10959 : see if signal is declared as pointer to function returning int or void
10961 xxx=`./findhdr signal.h`
10962 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10963 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10964 echo "You have int (*signal())() instead of void." >&4
10966 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10967 echo "You have void (*signal())()." >&4
10969 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10970 echo "You have int (*signal())() instead of void." >&4
10972 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10973 echo "You have void (*signal())()." >&4
10976 case "$d_voidsig" in
10978 echo "I can't determine whether signal handler returns void or int..." >&4
10980 rp="What type does your signal handler return?"
10983 v*) val="$define";;
10987 echo "As you already told me, signal handler returns void." >&4
10990 *) echo "As you already told me, signal handler returns int." >&4
10997 case "$d_voidsig" in
10998 "$define") signal_t="void";;
10999 *) signal_t="int";;
11003 : check for ability to cast large floats to 32-bit ints.
11005 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11006 if $test "$intsize" -ge 4; then
11013 #$i_stdlib I_STDLIB
11015 #include <stdlib.h>
11017 #include <sys/types.h>
11018 #include <signal.h>
11019 $signal_t blech(int s) { exit(3); }
11026 signal(SIGFPE, blech);
11028 /* Don't let compiler optimize the test away. Store the number
11029 in a writable string for gcc to pass to sscanf under HP-UX.
11031 sprintf(str, "2147483647");
11032 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11036 /* x86 processors will probably give 0x8000 0000, which is a
11037 sign change. We don't want that. We want to mimic SPARC
11038 behavior here, which is to preserve the sign and give
11041 if (i32 != ($xxx) f)
11047 if eval $compile_ok; then
11051 echo "(I can't seem to compile the test program--assuming it can't)"
11056 echo "Yup, it can."
11059 echo "Nope, it can't."
11066 : check for ability to cast negative floats to unsigned
11068 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11071 #$i_stdlib I_STDLIB
11073 #include <stdlib.h>
11075 #include <sys/types.h>
11076 #include <signal.h>
11077 $signal_t blech(int s) { exit(7); }
11078 $signal_t blech_in_list(int s) { exit(4); }
11079 unsigned long dummy_long(unsigned long p) { return p; }
11080 unsigned int dummy_int(unsigned int p) { return p; }
11081 unsigned short dummy_short(unsigned short p) { return p; }
11085 unsigned long along;
11087 unsigned short ashort;
11091 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11092 a direct f = -123. assignment. gcc-2.8.0 reportedly
11093 optimized the whole file away
11095 /* Store the number in a writable string for gcc to pass to
11096 sscanf under HP-UX.
11098 sprintf(str, "-123");
11099 sscanf(str, "%lf", &f); /* f = -123.; */
11101 signal(SIGFPE, blech);
11102 along = (unsigned long)f;
11103 aint = (unsigned int)f;
11104 ashort = (unsigned short)f;
11105 if (along != (unsigned long)-123)
11107 if (aint != (unsigned int)-123)
11109 if (ashort != (unsigned short)-123)
11111 sprintf(str, "1073741824.");
11112 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11115 along = (unsigned long)f;
11116 if (along != 0x80000000)
11120 along = (unsigned long)f;
11121 if (along != 0x7fffffff)
11125 along = (unsigned long)f;
11126 if (along != 0x80000001)
11130 signal(SIGFPE, blech_in_list);
11131 sprintf(str, "123.");
11132 sscanf(str, "%lf", &f); /* f = 123.; */
11133 along = dummy_long((unsigned long)f);
11134 aint = dummy_int((unsigned int)f);
11135 ashort = dummy_short((unsigned short)f);
11136 if (along != (unsigned long)123)
11138 if (aint != (unsigned int)123)
11140 if (ashort != (unsigned short)123)
11147 if eval $compile_ok; then
11151 echo "(I can't seem to compile the test program--assuming it can't)"
11154 case "$castflags" in
11156 echo "Yup, it can."
11159 echo "Nope, it can't."
11166 : see if vprintf exists
11168 if set vprintf val -f d_vprintf; eval $csym; $val; then
11169 echo 'vprintf() found.' >&4
11172 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11173 #$i_varargs I_VARARGS
11175 #$i_stdlib I_STDLIB
11176 #$i_unistd I_UNISTD
11179 # include <stdarg.h>
11180 #else /* I_VARARGS */
11181 # include <varargs.h>
11185 # include <unistd.h>
11189 # include <stdlib.h>
11192 #include <stdio.h> /* vsprintf prototype */
11195 void xxx(int n, ...)
11200 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11202 int main() { xxx(1, "foo"); }
11204 #else /* I_VARARGS */
11212 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11214 int main() { xxx("foo"); }
11220 if eval $compile_ok; then
11221 if $run ./try; then
11222 echo "Your vsprintf() returns (int)." >&4
11225 echo "Your vsprintf() returns (char*)." >&4
11229 echo 'I am unable to compile the vsprintf() test program.' >&4
11230 # We shouldn't get here. If we do, assume the standard signature,
11231 # not the old BSD one.
11232 echo 'Guessing that vsprintf() returns (int).' >&4
11236 echo 'vprintf() NOT found.' >&4
11247 : see if chown exists
11251 : see if chroot exists
11252 set chroot d_chroot
11255 : see if chsize exists
11256 set chsize d_chsize
11259 : see if class exists
11263 : see if clearenv exists
11264 set clearenv d_clearenv
11267 : Define hasstruct macro for Configure internal use
11268 hasstruct='varname=$1; struct=$2; shift; shift;
11269 while $test $# -ge 2; do
11271 $define) echo "#include <$2>";;
11275 echo "int main () { struct $struct foo; }" >> try.c;
11277 if eval $compile; then
11286 : see whether socket exists
11290 $echo $n "Hmm... $c" >&4
11291 if set socket val -f d_socket; eval $csym; $val; then
11292 echo "Looks like you have Berkeley networking support." >&4
11294 if set setsockopt val -f; eval $csym; $val; then
11297 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11298 d_oldsock="$define"
11301 if $contains socklib libc.list >/dev/null 2>&1; then
11302 echo "Looks like you have Berkeley networking support." >&4
11304 : we will have to assume that it supports the 4.2 BSD interface
11307 echo "You don't have Berkeley networking in libc$_a..." >&4
11308 if test "X$d_socket" = "X$define"; then
11309 echo "...but you seem to believe that you have sockets." >&4
11311 for net in net socket
11313 if test -f /usr/lib/lib$net$_a; then
11314 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11315 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11316 if $contains socket libc.list >/dev/null 2>&1; then
11321 echo "...but the Wollongong group seems to have hacked it in." >&4
11322 sockethdr="-I/usr/netinclude"
11325 echo "Found Berkeley sockets interface in lib$net." >&4
11326 if $contains setsockopt libc.list >/dev/null 2>&1; then
11329 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11330 d_oldsock="$define"
11336 if test "X$d_socket" != "X$define"; then
11337 echo "or anywhere else I see." >&4
11345 : see if socketpair exists
11346 set socketpair d_sockpair
11351 echo "Checking the availability sa_len in the sock struct ..." >&4
11353 #include <sys/types.h>
11354 #include <sys/socket.h>
11356 struct sockaddr sa;
11357 return (sa.sa_len);
11361 set try; if eval $compile; then
11364 set d_sockaddr_sa_len; eval $setvar
11368 echo "Checking the availability struct sockaddr_in6 ..." >&4
11370 #include <sys/types.h>
11371 #include <sys/socket.h>
11372 #include <netinet/in.h>
11374 struct sockaddr_in6 sin6;
11375 return (sin6.sin6_family);
11379 set try; if eval $compile; then
11382 set d_sockaddr_in6; eval $setvar
11386 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11388 #include <sys/types.h>
11389 #include <sys/socket.h>
11390 #include <netinet/in.h>
11392 struct sockaddr_in6 sin6;
11393 return (sin6.sin6_scope_id);
11397 set try; if eval $compile; then
11400 set d_sin6_scope_id; eval $setvar
11404 echo "Checking the availability struct ip_mreq ..." >&4
11406 #include <sys/types.h>
11407 #include <sys/socket.h>
11408 #include <netinet/in.h>
11410 struct ip_mreq mreq;
11411 return (mreq.imr_multiaddr.s_addr);
11415 set try; if eval $compile; then
11418 set d_ip_mreq; eval $setvar
11422 echo "Checking the availability struct ip_mreq_source ..." >&4
11424 #include <sys/types.h>
11425 #include <sys/socket.h>
11426 #include <netinet/in.h>
11428 struct ip_mreq_source mreq;
11429 return (mreq.imr_multiaddr.s_addr);
11433 set try; if eval $compile; then
11436 set d_ip_mreq_source; eval $setvar
11440 echo "Checking the availability struct ipv6_mreq ..." >&4
11442 #include <sys/types.h>
11443 #include <sys/socket.h>
11444 #include <netinet/in.h>
11446 struct ipv6_mreq mreq;
11447 return (mreq.ipv6mr_interface);
11451 set try; if eval $compile; then
11454 set d_ipv6_mreq; eval $setvar
11458 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11460 #include <sys/types.h>
11461 #include <sys/socket.h>
11462 #include <netinet/in.h>
11464 struct ipv6_mreq_source mreq;
11465 return (mreq.imr_multiaddr.s_addr);
11469 set try; if eval $compile; then
11472 set d_ipv6_mreq_source; eval $setvar
11476 echo "Checking the availability of certain socket constants..." >&4
11477 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11478 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11480 #include <sys/types.h>
11481 #include <sys/socket.h>
11487 set try; if eval $compile; then
11490 set d_${enum}; eval $setvar
11494 : see if this is a sys/uio.h system
11495 set sys/uio.h i_sysuio
11498 : Check for cmsghdr support
11500 echo "Checking to see if your system supports struct cmsghdr..." >&4
11501 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11503 case "$d_cmsghdr_s" in
11504 "$define") echo "Yes, it does." ;;
11505 *) echo "No, it doesn't." ;;
11509 : check for const keyword
11511 echo 'Checking to see if your C compiler knows about "const"...' >&4
11512 $cat >const.c <<'EOCP'
11513 typedef struct spug { int drokk; } spug;
11517 const spug y = { 0 };
11520 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11522 echo "Yup, it does."
11525 echo "Nope, it doesn't."
11530 : see if copysignl exists
11531 set copysignl d_copysignl
11534 : see if crypt exists
11539 $define) cryptlib='' ;;
11540 *) if set crypt val -f d_crypt; eval $csym; $val; then
11541 echo 'crypt() found.' >&4
11545 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11546 if $test -z "$cryptlib"; then
11547 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11551 if $test -z "$cryptlib"; then
11552 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11556 if $test -z "$cryptlib"; then
11557 cryptlib=`./loc libcrypt$_a "" $libpth`
11561 if $test -z "$cryptlib"; then
11562 echo 'crypt() NOT found.' >&4
11573 : see if this is a crypt.h system
11574 set crypt.h i_crypt
11577 : see if crypt_r exists
11578 set crypt_r d_crypt_r
11580 case "$d_crypt_r" in
11582 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11583 case "$d_crypt_r_proto:$usethreads" in
11584 ":define") d_crypt_r_proto=define
11585 set d_crypt_r_proto crypt_r $hdrs
11589 case "$d_crypt_r_proto" in
11591 case "$crypt_r_proto" in
11592 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11593 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11595 case "$crypt_r_proto" in
11596 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11597 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11599 case "$crypt_r_proto" in
11600 ''|0) d_crypt_r=undef
11602 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11603 * ) case "$crypt_r_proto" in
11604 REENTRANT_PROTO*) ;;
11605 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11607 echo "Prototype: $try" ;;
11610 *) case "$usethreads" in
11611 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11622 : get csh whereabouts
11624 'csh') val="$undef" ;;
11625 *) val="$define" ;;
11629 : Respect a hint or command line value for full_csh.
11630 case "$full_csh" in
11631 '') full_csh=$csh ;;
11634 : see if ctermid exists
11635 set ctermid d_ctermid
11638 : see if ctermid_r exists
11639 set ctermid_r d_ctermid_r
11641 case "$d_ctermid_r" in
11643 hdrs="$i_systypes sys/types.h define stdio.h "
11644 case "$d_ctermid_r_proto:$usethreads" in
11645 ":define") d_ctermid_r_proto=define
11646 set d_ctermid_r_proto ctermid_r $hdrs
11650 case "$d_ctermid_r_proto" in
11652 case "$ctermid_r_proto" in
11653 ''|0) try='char* ctermid_r(char*);'
11654 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11656 case "$ctermid_r_proto" in
11657 ''|0) d_ctermid_r=undef
11659 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11660 * ) case "$ctermid_r_proto" in
11661 REENTRANT_PROTO*) ;;
11662 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11664 echo "Prototype: $try" ;;
11667 *) case "$usethreads" in
11668 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11675 *) ctermid_r_proto=0
11679 : see if ctime_r exists
11680 set ctime_r d_ctime_r
11682 case "$d_ctime_r" in
11684 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11685 case "$d_ctime_r_proto:$usethreads" in
11686 ":define") d_ctime_r_proto=define
11687 set d_ctime_r_proto ctime_r $hdrs
11691 case "$d_ctime_r_proto" in
11693 case "$ctime_r_proto" in
11694 ''|0) try='char* ctime_r(const time_t*, char*);'
11695 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11697 case "$ctime_r_proto" in
11698 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11699 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11701 case "$ctime_r_proto" in
11702 ''|0) try='int ctime_r(const time_t*, char*);'
11703 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11705 case "$ctime_r_proto" in
11706 ''|0) try='int ctime_r(const time_t*, char*, int);'
11707 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11709 case "$ctime_r_proto" in
11710 ''|0) d_ctime_r=undef
11712 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11713 * ) case "$ctime_r_proto" in
11714 REENTRANT_PROTO*) ;;
11715 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11717 echo "Prototype: $try" ;;
11720 *) case "$usethreads" in
11721 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11732 : see if cuserid exists
11733 set cuserid d_cuserid
11736 : see if this is a limits.h system
11737 set limits.h i_limits
11740 : see if this is a float.h system
11741 set float.h i_float
11744 : See if number of significant digits in a double precision number is known
11746 $cat >dbl_dig.c <<EOM
11747 #$i_limits I_LIMITS
11750 #include <limits.h>
11756 printf("Contains DBL_DIG");
11759 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11760 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11761 echo "DBL_DIG found." >&4
11764 echo "DBL_DIG NOT found." >&4
11771 : see if dbm.h is available
11772 : see if dbmclose exists
11773 set dbmclose d_dbmclose
11776 case "$d_dbmclose" in
11786 *) set rpcsvc/dbm.h i_rpcsvcdbm
11791 *) echo "We won't be including <dbm.h>"
11801 : see if prototype for dbminit is available
11803 set d_dbminitproto dbminit $i_dbm dbm.h
11806 : see if difftime exists
11807 set difftime d_difftime
11810 : see if this is a dirent system
11812 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11814 echo "<dirent.h> found." >&4
11817 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11818 echo "<sys/dir.h> found." >&4
11821 xinc=`./findhdr sys/ndir.h`
11823 echo "<dirent.h> NOT found." >&4
11828 : Look for type of directory structure.
11830 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11832 case "$direntrytype" in
11834 case "$i_dirent" in
11835 $define) guess1='struct dirent' ;;
11836 *) guess1='struct direct' ;;
11839 *) guess1="$direntrytype"
11844 'struct dirent') guess2='struct direct' ;;
11845 *) guess2='struct dirent' ;;
11848 if $contains "$guess1" try.c >/dev/null 2>&1; then
11849 direntrytype="$guess1"
11850 echo "Your directory entries are $direntrytype." >&4
11851 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11852 direntrytype="$guess2"
11853 echo "Your directory entries seem to be $direntrytype." >&4
11855 echo "I don't recognize your system's directory entries." >&4
11856 rp="What type is used for directory entries on this system?"
11859 direntrytype="$ans"
11863 : see if the directory entry stores field length
11865 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11866 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11867 echo "Good, your directory entry keeps length information in d_namlen." >&4
11870 echo "Your directory entry does not know about the d_namlen field." >&4
11877 : Look for DIR.dd_fd
11878 case "$i_dirent" in
11880 echo "Checking to see if DIR has a dd_fd member variable" >&4
11882 #$i_stdlib I_STDLIB
11884 #include <stdlib.h>
11886 #include <dirent.h>
11896 if eval $compile; then
11897 echo "Yes, it does."
11900 echo "No, it does not."
11905 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11913 : see if this is an sysdir system
11914 set sys/dir.h i_sysdir
11917 : see if this is an sysndir system
11918 set sys/ndir.h i_sysndir
11923 $cat >dirfd.c <<EOM
11925 #$i_stdlib I_STDLIB
11927 #include <stdlib.h>
11929 #$i_dirent I_DIRENT /**/
11930 #$i_sysdir I_SYS_DIR /**/
11931 #$i_sysndir I_SYS_NDIR /**/
11932 #$i_systypes I_SYS_TYPES /**/
11933 #if defined(I_SYS_TYPES)
11934 #include <sys/types.h>
11936 #if defined(I_DIRENT)
11937 #include <dirent.h>
11938 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11939 #include <sys/dir.h>
11943 #include <sys/ndir.h>
11947 #include <ndir.h> /* may be wrong in the future */
11949 #include <sys/dir.h>
11955 DIR *dirp = opendir(".");
11956 if (dirfd(dirp) >= 0)
11964 if eval $compile; then
11968 $define) echo "dirfd() found." >&4 ;;
11969 *) echo "dirfd() NOT found." >&4 ;;
11975 : see if dlerror exists
11978 set dlerror d_dlerror
11982 : see if dlfcn is available
11983 set dlfcn.h i_dlfcn
11986 : Check what extension to use for shared libs
11991 On a few systems, the dynamically loaded modules that perl generates and uses
11992 will need a different extension than shared libs. The default will probably
11998 *) dflt="$dlext" ;;
12000 rp='What is the extension of dynamically loaded modules'
12009 : Check if dlsym need a leading underscore
12015 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12016 $cat >dyna.c <<'EOM'
12023 #$i_stdlib I_STDLIB
12025 #include <stdlib.h>
12029 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12031 #include <sys/types.h>
12036 extern int fred() ;
12045 int mode = RTLD_LAZY ;
12047 handle = dlopen("./dyna.$dlext", mode) ;
12048 if (handle == NULL) {
12053 symbol = dlsym(handle, "fred") ;
12054 if (symbol == NULL) {
12055 /* try putting a leading underscore */
12056 symbol = dlsym(handle, "_fred") ;
12057 if (symbol == NULL) {
12070 : Call the object file tmp-dyna.o in case dlext=o.
12071 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12072 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12073 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12074 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12077 1) echo "Test program failed using dlopen." >&4
12078 echo "Perhaps you should not use dynamic loading." >&4;;
12079 2) echo "Test program failed using dlsym." >&4
12080 echo "Perhaps you should not use dynamic loading." >&4;;
12081 3) echo "dlsym needs a leading underscore" >&4
12083 4) echo "dlsym doesn't need a leading underscore." >&4;;
12086 echo "I can't compile and run the test program." >&4
12087 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12092 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12097 : see if drand48_r exists
12098 set drand48_r d_drand48_r
12100 case "$d_drand48_r" in
12102 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12103 case "$d_drand48_r_proto:$usethreads" in
12104 ":define") d_drand48_r_proto=define
12105 set d_drand48_r_proto drand48_r $hdrs
12109 case "$d_drand48_r_proto" in
12111 case "$drand48_r_proto" in
12112 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12113 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12115 case "$drand48_r_proto" in
12116 ''|0) d_drand48_r=undef
12118 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12119 * ) case "$drand48_r_proto" in
12120 REENTRANT_PROTO*) ;;
12121 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12123 echo "Prototype: $try" ;;
12126 *) case "$usethreads" in
12127 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12134 *) drand48_r_proto=0
12138 : see if prototype for drand48 is available
12140 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12143 : see if dup2 exists
12147 : see if eaccess exists
12148 set eaccess d_eaccess
12151 : see if endgrent exists
12152 set endgrent d_endgrent
12155 : see if this is an grp system
12161 xxx=`./findhdr grp.h`
12162 $cppstdin $cppflags $cppminus < $xxx >$$.h
12164 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12176 set d_grpasswd; eval $setvar
12180 : see if endgrent_r exists
12181 set endgrent_r d_endgrent_r
12183 case "$d_endgrent_r" in
12185 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12186 case "$d_endgrent_r_proto:$usethreads" in
12187 ":define") d_endgrent_r_proto=define
12188 set d_endgrent_r_proto endgrent_r $hdrs
12192 case "$d_endgrent_r_proto" in
12194 case "$endgrent_r_proto" in
12195 ''|0) try='int endgrent_r(FILE**);'
12196 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12198 case "$endgrent_r_proto" in
12199 ''|0) try='void endgrent_r(FILE**);'
12200 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12202 case "$endgrent_r_proto" in
12203 ''|0) d_endgrent_r=undef
12205 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12206 * ) case "$endgrent_r_proto" in
12207 REENTRANT_PROTO*) ;;
12208 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12210 echo "Prototype: $try" ;;
12213 *) case "$usethreads" in
12214 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12221 *) endgrent_r_proto=0
12225 : see if endhostent exists
12226 set endhostent d_endhent
12229 : see if this is a netdb.h system
12230 set netdb.h i_netdb
12233 : see if endhostent_r exists
12234 set endhostent_r d_endhostent_r
12236 case "$d_endhostent_r" in
12238 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12239 case "$d_endhostent_r_proto:$usethreads" in
12240 ":define") d_endhostent_r_proto=define
12241 set d_endhostent_r_proto endhostent_r $hdrs
12245 case "$d_endhostent_r_proto" in
12247 case "$endhostent_r_proto" in
12248 ''|0) try='int endhostent_r(struct hostent_data*);'
12249 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12251 case "$endhostent_r_proto" in
12252 ''|0) try='void endhostent_r(struct hostent_data*);'
12253 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12255 case "$endhostent_r_proto" in
12256 ''|0) d_endhostent_r=undef
12257 endhostent_r_proto=0
12258 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12259 * ) case "$endhostent_r_proto" in
12260 REENTRANT_PROTO*) ;;
12261 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12263 echo "Prototype: $try" ;;
12266 *) case "$usethreads" in
12267 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12269 d_endhostent_r=undef
12270 endhostent_r_proto=0
12274 *) endhostent_r_proto=0
12278 : see if endnetent exists
12279 set endnetent d_endnent
12282 : see if endnetent_r exists
12283 set endnetent_r d_endnetent_r
12285 case "$d_endnetent_r" in
12287 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12288 case "$d_endnetent_r_proto:$usethreads" in
12289 ":define") d_endnetent_r_proto=define
12290 set d_endnetent_r_proto endnetent_r $hdrs
12294 case "$d_endnetent_r_proto" in
12296 case "$endnetent_r_proto" in
12297 ''|0) try='int endnetent_r(struct netent_data*);'
12298 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12300 case "$endnetent_r_proto" in
12301 ''|0) try='void endnetent_r(struct netent_data*);'
12302 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12304 case "$endnetent_r_proto" in
12305 ''|0) d_endnetent_r=undef
12306 endnetent_r_proto=0
12307 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12308 * ) case "$endnetent_r_proto" in
12309 REENTRANT_PROTO*) ;;
12310 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12312 echo "Prototype: $try" ;;
12315 *) case "$usethreads" in
12316 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12318 d_endnetent_r=undef
12319 endnetent_r_proto=0
12323 *) endnetent_r_proto=0
12327 : see if endprotoent exists
12328 set endprotoent d_endpent
12331 : see if endprotoent_r exists
12332 set endprotoent_r d_endprotoent_r
12334 case "$d_endprotoent_r" in
12336 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12337 case "$d_endprotoent_r_proto:$usethreads" in
12338 ":define") d_endprotoent_r_proto=define
12339 set d_endprotoent_r_proto endprotoent_r $hdrs
12343 case "$d_endprotoent_r_proto" in
12345 case "$endprotoent_r_proto" in
12346 ''|0) try='int endprotoent_r(struct protoent_data*);'
12347 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12349 case "$endprotoent_r_proto" in
12350 ''|0) try='void endprotoent_r(struct protoent_data*);'
12351 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12353 case "$endprotoent_r_proto" in
12354 ''|0) d_endprotoent_r=undef
12355 endprotoent_r_proto=0
12356 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12357 * ) case "$endprotoent_r_proto" in
12358 REENTRANT_PROTO*) ;;
12359 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12361 echo "Prototype: $try" ;;
12364 *) case "$usethreads" in
12365 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12367 d_endprotoent_r=undef
12368 endprotoent_r_proto=0
12372 *) endprotoent_r_proto=0
12376 : see if endpwent exists
12377 set endpwent d_endpwent
12380 : see if this is a pwd.h system
12386 xxx=`./findhdr pwd.h`
12387 $cppstdin $cppflags $cppminus < $xxx >$$.h
12389 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12397 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12405 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12413 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12421 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12429 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12437 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12445 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12457 set d_pwquota; eval $setvar
12458 set d_pwage; eval $setvar
12459 set d_pwchange; eval $setvar
12460 set d_pwclass; eval $setvar
12461 set d_pwexpire; eval $setvar
12462 set d_pwcomment; eval $setvar
12463 set d_pwgecos; eval $setvar
12464 set d_pwpasswd; eval $setvar
12468 : see if endpwent_r exists
12469 set endpwent_r d_endpwent_r
12471 case "$d_endpwent_r" in
12473 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12474 case "$d_endpwent_r_proto:$usethreads" in
12475 ":define") d_endpwent_r_proto=define
12476 set d_endpwent_r_proto endpwent_r $hdrs
12480 case "$d_endpwent_r_proto" in
12482 case "$endpwent_r_proto" in
12483 ''|0) try='int endpwent_r(FILE**);'
12484 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12486 case "$endpwent_r_proto" in
12487 ''|0) try='void endpwent_r(FILE**);'
12488 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12490 case "$endpwent_r_proto" in
12491 ''|0) d_endpwent_r=undef
12493 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12494 * ) case "$endpwent_r_proto" in
12495 REENTRANT_PROTO*) ;;
12496 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12498 echo "Prototype: $try" ;;
12501 *) case "$usethreads" in
12502 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12509 *) endpwent_r_proto=0
12513 : see if endservent exists
12514 set endservent d_endsent
12517 : see if endservent_r exists
12518 set endservent_r d_endservent_r
12520 case "$d_endservent_r" in
12522 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12523 case "$d_endservent_r_proto:$usethreads" in
12524 ":define") d_endservent_r_proto=define
12525 set d_endservent_r_proto endservent_r $hdrs
12529 case "$d_endservent_r_proto" in
12531 case "$endservent_r_proto" in
12532 ''|0) try='int endservent_r(struct servent_data*);'
12533 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12535 case "$endservent_r_proto" in
12536 ''|0) try='void endservent_r(struct servent_data*);'
12537 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12539 case "$endservent_r_proto" in
12540 ''|0) d_endservent_r=undef
12541 endservent_r_proto=0
12542 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12543 * ) case "$endservent_r_proto" in
12544 REENTRANT_PROTO*) ;;
12545 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12547 echo "Prototype: $try" ;;
12550 *) case "$usethreads" in
12551 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12553 d_endservent_r=undef
12554 endservent_r_proto=0
12558 *) endservent_r_proto=0
12562 : Locate the flags for 'open()'
12565 #include <sys/types.h>
12570 #include <sys/file.h>
12572 #$i_stdlib I_STDLIB
12574 #include <stdlib.h>
12585 : check sys/file.h first to get FREAD on Sun
12586 if $test `./findhdr sys/file.h` && \
12587 set try -DI_SYS_FILE && eval $compile; then
12589 echo "<sys/file.h> defines the O_* constants..." >&4
12590 if $run ./try; then
12591 echo "and you have the 3 argument form of open()." >&4
12594 echo "but not the 3 argument form of open(). Oh, well." >&4
12597 elif $test `./findhdr fcntl.h` && \
12598 set try -DI_FCNTL && eval $compile; then
12600 echo "<fcntl.h> defines the O_* constants..." >&4
12601 if $run ./try; then
12602 echo "and you have the 3 argument form of open()." >&4
12605 echo "but not the 3 argument form of open(). Oh, well." >&4
12610 echo "I can't find the O_* constant definitions! You got problems." >&4
12616 : see if this is a sys/file.h system
12621 : do we need to include sys/file.h ?
12625 if $h_sysfile; then
12627 echo "We'll be including <sys/file.h>." >&4
12630 echo "We won't be including <sys/file.h>." >&4
12640 : see if fcntl.h is there
12645 : see if we can include fcntl.h
12651 echo "We'll be including <fcntl.h>." >&4
12654 if $h_sysfile; then
12655 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12657 echo "We won't be including <fcntl.h>." >&4
12669 : see if fork exists
12673 : see if pipe exists
12677 : check for non-blocking I/O stuff
12678 case "$h_sysfile" in
12679 true) echo "#include <sys/file.h>" > head.c;;
12682 true) echo "#include <fcntl.h>" > head.c;;
12683 *) echo "#include <sys/fcntl.h>" > head.c;;
12688 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12689 case "$o_nonblock" in
12691 $cat head.c > try.c
12692 $cat >>try.c <<EOCP
12694 #$i_stdlib I_STDLIB
12696 #include <stdlib.h>
12704 printf("O_NONBLOCK\n");
12708 printf("O_NDELAY\n");
12712 printf("FNDELAY\n");
12719 if eval $compile_ok; then
12720 o_nonblock=`$run ./try`
12721 case "$o_nonblock" in
12722 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12723 *) echo "Seems like we can use $o_nonblock.";;
12726 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12729 *) echo "Using $hint value $o_nonblock.";;
12734 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12737 case "$d_fork:$d_pipe" in
12739 $cat head.c > try.c
12740 $cat >>try.c <<EOCP
12742 #include <sys/types.h>
12743 #include <signal.h>
12745 #$i_stdlib I_STDLIB
12747 #include <stdlib.h>
12753 #define MY_O_NONBLOCK $o_nonblock
12754 #ifndef errno /* XXX need better Configure test */
12757 #$i_unistd I_UNISTD
12759 #include <unistd.h>
12761 #$i_string I_STRING
12763 #include <string.h>
12765 #include <strings.h>
12767 $signal_t blech(int x) { exit(3); }
12769 $cat >> try.c <<'EOCP'
12777 pipe(pd); /* Down: child -> parent */
12778 pipe(pu); /* Up: parent -> child */
12781 close(pd[1]); /* Parent reads from pd[0] */
12782 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12784 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12789 signal(SIGALRM, blech);
12791 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12793 sprintf(string, "%d\n", ret);
12794 write(2, string, strlen(string));
12797 if (errno == EAGAIN) {
12798 printf("EAGAIN\n");
12803 if (errno == EWOULDBLOCK)
12804 printf("EWOULDBLOCK\n");
12807 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12808 sleep(2); /* Give it time to close our pipe */
12810 ret = read(pd[0], buf, 1); /* Should read EOF */
12812 sprintf(string, "%d\n", ret);
12813 write(4, string, strlen(string));
12817 close(pd[0]); /* We write to pd[1] */
12818 close(pu[1]); /* We read from pu[0] */
12819 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12820 close(pd[1]); /* Pipe pd is now fully closed! */
12821 exit(0); /* Bye bye, thank you for playing! */
12825 if eval $compile_ok; then
12826 echo "$startsh" >mtry
12827 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12829 ./mtry >/dev/null 2>&1
12831 0) eagain=`$cat try.out`;;
12832 1) echo "Could not perform non-blocking setting!";;
12833 2) echo "I did a successful read() for something that was not there!";;
12834 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12835 4) echo "Could not find F_SETFL!";;
12836 *) echo "Something terribly wrong happened during testing.";;
12838 rd_nodata=`$cat try.ret`
12839 echo "A read() system call with no data present returns $rd_nodata."
12840 case "$rd_nodata" in
12843 echo "(That's peculiar, fixing that to be -1.)"
12849 echo "Forcing errno EAGAIN on read() with no data available."
12853 echo "Your read() sets errno to $eagain when no data is available."
12856 status=`$cat try.err`
12858 0) echo "And it correctly returns 0 to signal EOF.";;
12859 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12860 *) echo "However, your read() returns '$status' on EOF??";;
12863 if test "$status" = "$rd_nodata"; then
12864 echo "WARNING: you can't distinguish between EOF and no data!"
12868 echo "I can't compile the test program--assuming errno EAGAIN will do."
12872 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12881 echo "Using $hint value $eagain."
12882 echo "Your read() returns $rd_nodata when no data is present."
12883 case "$d_eofnblk" in
12884 "$define") echo "And you can see EOF because read() returns 0.";;
12885 "$undef") echo "But you can't see EOF status from read() returned value.";;
12887 echo "(Assuming you can't see EOF status from read anyway.)"
12893 $rm_try head.c mtry
12895 : see if _ptr and _cnt from stdio act std
12898 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12899 echo "(Looks like you have stdio.h from BSD.)"
12900 case "$stdio_ptr" in
12901 '') stdio_ptr='((fp)->_p)'
12904 *) ptr_lval=$d_stdio_ptr_lval;;
12906 case "$stdio_cnt" in
12907 '') stdio_cnt='((fp)->_r)'
12910 *) cnt_lval=$d_stdio_cnt_lval;;
12912 case "$stdio_base" in
12913 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12915 case "$stdio_bufsiz" in
12916 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12918 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12919 echo "(Looks like you have stdio.h from Linux.)"
12920 case "$stdio_ptr" in
12921 '') stdio_ptr='((fp)->_IO_read_ptr)'
12924 *) ptr_lval=$d_stdio_ptr_lval;;
12926 case "$stdio_cnt" in
12927 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12930 *) cnt_lval=$d_stdio_cnt_lval;;
12932 case "$stdio_base" in
12933 '') stdio_base='((fp)->_IO_read_base)';;
12935 case "$stdio_bufsiz" in
12936 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12939 case "$stdio_ptr" in
12940 '') stdio_ptr='((fp)->_ptr)'
12943 *) ptr_lval=$d_stdio_ptr_lval;;
12945 case "$stdio_cnt" in
12946 '') stdio_cnt='((fp)->_cnt)'
12949 *) cnt_lval=$d_stdio_cnt_lval;;
12951 case "$stdio_base" in
12952 '') stdio_base='((fp)->_base)';;
12954 case "$stdio_bufsiz" in
12955 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12959 : test whether _ptr and _cnt really work
12960 echo "Checking how std your stdio is..." >&4
12963 #$i_stdlib I_STDLIB
12965 #include <stdlib.h>
12967 #define FILE_ptr(fp) $stdio_ptr
12968 #define FILE_cnt(fp) $stdio_cnt
12970 FILE *fp = fopen("try.c", "r");
12973 18 <= FILE_cnt(fp) &&
12974 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12982 if eval $compile && $to try.c; then
12983 if $run ./try; then
12984 echo "Your stdio acts pretty std."
12987 echo "Your stdio isn't very std."
12990 echo "Your stdio doesn't appear very std."
12994 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12995 # direct buffer manipulation no longer works. The Configure tests
12996 # should be changed to correctly detect this, but until then,
12997 # the following check should at least let perl compile and run.
12998 # (This quick fix should be updated before 5.8.1.)
12999 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13000 # A. Dougherty, June 3, 2002.
13001 case "$d_gnulibc" in
13003 case "$gnulibc_version" in
13007 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13016 : Can _ptr be used as an lvalue?
13017 case "$d_stdstdio$ptr_lval" in
13018 $define$define) val=$define ;;
13021 set d_stdio_ptr_lval
13024 : Can _cnt be used as an lvalue?
13025 case "$d_stdstdio$cnt_lval" in
13026 $define$define) val=$define ;;
13029 set d_stdio_cnt_lval
13033 : test whether setting _ptr sets _cnt as a side effect
13034 d_stdio_ptr_lval_sets_cnt="$undef"
13035 d_stdio_ptr_lval_nochange_cnt="$undef"
13036 case "$d_stdio_ptr_lval$d_stdstdio" in
13038 echo "Checking to see what happens if we set the stdio ptr..." >&4
13041 /* Can we scream? */
13042 /* Eat dust sed :-) */
13043 /* In the buffer space, no one can hear you scream. */
13044 #$i_stdlib I_STDLIB
13046 #include <stdlib.h>
13048 #define FILE_ptr(fp) $stdio_ptr
13049 #define FILE_cnt(fp) $stdio_cnt
13050 #include <sys/types.h>
13052 FILE *fp = fopen("try.c", "r");
13057 puts("Fail even to read");
13060 c = getc(fp); /* Read away the first # */
13062 puts("Fail even to read");
13066 18 <= FILE_cnt(fp) &&
13067 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13069 puts("Fail even to read");
13072 ptr = (char*) FILE_ptr(fp);
13073 cnt = (size_t)FILE_cnt(fp);
13075 FILE_ptr(fp) += 42;
13077 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13078 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13081 if (FILE_cnt(fp) <= 20) {
13082 printf ("Fail (<20 chars to test)");
13085 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13086 puts("Fail compare");
13089 if (cnt == FILE_cnt(fp)) {
13090 puts("Pass_unchanged");
13093 if (FILE_cnt(fp) == (cnt - 42)) {
13094 puts("Pass_changed");
13097 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13103 if eval $compile && $to try.c; then
13104 case `$run ./try` in
13106 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13107 d_stdio_ptr_lval_sets_cnt="$define" ;;
13109 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13110 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13112 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13114 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13117 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13123 : see if _base is also standard
13125 case "$d_stdstdio" in
13129 #$i_stdlib I_STDLIB
13131 #include <stdlib.h>
13133 #define FILE_base(fp) $stdio_base
13134 #define FILE_bufsiz(fp) $stdio_bufsiz
13136 FILE *fp = fopen("try.c", "r");
13139 19 <= FILE_bufsiz(fp) &&
13140 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13147 if eval $compile && $to try.c; then
13148 if $run ./try; then
13149 echo "And its _base field acts std."
13152 echo "But its _base field isn't std."
13155 echo "However, it seems to be lacking the _base field."
13163 : see if fast_stdio exists
13165 case "$d_stdstdio:$d_stdio_ptr_lval" in
13167 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13169 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13180 : see if fchdir exists
13181 set fchdir d_fchdir
13184 : see if fchmod exists
13185 set fchmod d_fchmod
13188 : see if fchown exists
13189 set fchown d_fchown
13192 : see if this is an fcntl system
13196 : See if fcntl-based locking works.
13199 #$i_stdlib I_STDLIB
13201 #include <stdlib.h>
13203 #include <unistd.h>
13205 #include <signal.h>
13206 $signal_t blech(int x) { exit(3); }
13208 #if defined(F_SETLK) && defined(F_SETLKW)
13209 struct flock flock;
13211 fd = open("try.c", O_RDONLY);
13212 flock.l_type = F_RDLCK;
13213 flock.l_whence = SEEK_SET;
13214 flock.l_start = flock.l_len = 0;
13215 signal(SIGALRM, blech);
13217 retval = fcntl(fd, F_SETLK, &flock);
13219 (retval < 0 ? exit(2) : exit(0));
13225 echo "Checking if fcntl-based file locking works... "
13229 if eval $compile_ok; then
13230 if $run ./try; then
13231 echo "Yes, it seems to work."
13234 echo "Nope, it didn't work."
13239 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13240 *** This is (almost) impossible.
13241 *** If your NFS lock daemons are not feeling well, something like
13242 *** this may happen, please investigate. Cannot continue, aborting.
13250 echo "I'm unable to compile the test program, so I'll assume not."
13255 echo "Nope, since you don't even have fcntl()."
13258 set d_fcntl_can_lock
13262 : check for fd_set items
13265 Checking to see how well your C compiler handles fd_set and friends ...
13268 #$i_stdlib I_STDLIB
13270 #include <stdlib.h>
13272 #$i_systime I_SYS_TIME
13273 #$i_sysselct I_SYS_SELECT
13274 #$d_socket HAS_SOCKET
13275 #include <sys/types.h>
13277 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13280 #include <sys/time.h>
13282 #ifdef I_SYS_SELECT
13283 #include <sys/select.h>
13292 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13300 if eval $compile; then
13301 d_fds_bits="$define"
13303 echo "Well, your system knows about the normal fd_set typedef..." >&4
13304 if $run ./try; then
13305 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13306 d_fd_macros="$define"
13309 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13311 d_fd_macros="$undef"
13315 Hmm, your compiler has some difficulty with fd_set. Checking further...
13318 if eval $compile; then
13319 d_fds_bits="$undef"
13321 echo "Well, your system has some sort of fd_set available..." >&4
13322 if $run ./try; then
13323 echo "and you have the normal fd_set macros." >&4
13324 d_fd_macros="$define"
13327 but not the normal fd_set macros! Gross! More work for me...
13329 d_fd_macros="$undef"
13332 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13334 d_fds_bits="$undef"
13335 d_fd_macros="$undef"
13340 : see if fgetpos exists
13341 set fgetpos d_fgetpos
13344 : see if finite exists
13345 set finite d_finite
13348 : see if finitel exists
13349 set finitel d_finitel
13352 : see if flock exists
13356 : see if prototype for flock is available
13358 set d_flockproto flock $i_sysfile sys/file.h
13361 : see if fp_class exists
13362 set fp_class d_fp_class
13365 : see if pathconf exists
13366 set pathconf d_pathconf
13369 : see if fpathconf exists
13370 set fpathconf d_fpathconf
13373 : see if fpclass exists
13374 set fpclass d_fpclass
13377 : see if fpclassify exists
13378 set fpclassify d_fpclassify
13381 : see if fpclassl exists
13382 set fpclassl d_fpclassl
13385 : check for fpos64_t
13387 echo "Checking to see if you have fpos64_t..." >&4
13390 int main() { fpos64_t x = 7; }
13393 if eval $compile; then
13395 echo "You have fpos64_t."
13398 echo "You do not have fpos64_t."
13399 case "$fpossize" in
13400 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13407 : see if frexpl exists
13408 set frexpl d_frexpl
13411 : see if this is a sys/param system
13412 set sys/param.h i_sysparam
13415 : see if this is a sys/mount.h system
13416 set sys/mount.h i_sysmount
13419 : Check for fs_data_s
13421 echo "Checking to see if your system supports struct fs_data..." >&4
13422 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13424 case "$d_fs_data_s" in
13425 "$define") echo "Yes, it does." ;;
13426 *) echo "No, it doesn't." ;;
13429 : see if fseeko exists
13430 set fseeko d_fseeko
13432 case "$longsize" in
13433 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13436 : see if fsetpos exists
13437 set fsetpos d_fsetpos
13440 : see if fstatfs exists
13441 set fstatfs d_fstatfs
13444 : see if statvfs exists
13445 set statvfs d_statvfs
13448 : see if fstatvfs exists
13449 set fstatvfs d_fstatvfs
13453 : see if fsync exists
13457 : see if ftello exists
13458 set ftello d_ftello
13460 case "$longsize" in
13461 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13464 : check for a working futimes
13467 echo "Checking if you have a working futimes()" >&4
13470 #include <sys/time.h>
13477 fd = open ("try.c", O_RDWR);
13478 if (-1 == fd) exit (1);
13479 rv = futimes (fd, NULL);
13480 exit (rv == -1 ? errno : 0);
13484 if eval $compile; then
13488 0) echo "Yes, you have" >&4
13489 d_futimes="$define"
13491 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13495 echo "No, it does not (probably harmless)" >&4
13499 : see if ndbm.h is available
13502 : Compatibility location for RedHat 7.1
13503 set gdbm/ndbm.h i_gdbmndbm
13505 : Compatibility location for Debian 4.0
13506 set gdbm-ndbm.h i_gdbm_ndbm
13510 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13511 : see if dbm_open exists
13512 set dbm_open d_dbm_open
13514 case "$d_dbm_open" in
13517 i_gdbmndbm="$undef"
13518 i_gdbm_ndbm="$undef"
13519 echo "We won't be including <ndbm.h>"
13529 ndbm_hdr_protochk='name=$1; hdr=$2;
13530 eval "ihdr=\$""i_$name";
13532 if $test "$ihdr" = "$define"; then
13533 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13534 case "$d_cplusplus" in
13535 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13536 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13539 $define) $echo "Your <$hdr> seems to have prototypes";;
13540 *) $echo "Your <$hdr> does not seem to have prototypes";;
13543 set "d_${name}_h_uses_prototypes";
13547 eval $ndbm_hdr_protochk
13548 set gdbmndbm gdbm/ndbm.h
13549 eval $ndbm_hdr_protochk
13550 set gdbm_ndbm gdbm-ndbm.h
13551 eval $ndbm_hdr_protochk
13553 : see if getaddrinfo exists
13554 set getaddrinfo d_getaddrinfo
13557 : see if getcwd exists
13558 set getcwd d_getcwd
13561 : see if getespwnam exists
13562 set getespwnam d_getespwnam
13565 : see if getfsstat exists
13566 set getfsstat d_getfsstat
13569 : see if getgrent exists
13570 set getgrent d_getgrent
13573 : see if getgrent_r exists
13574 set getgrent_r d_getgrent_r
13576 case "$d_getgrent_r" in
13578 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13579 case "$d_getgrent_r_proto:$usethreads" in
13580 ":define") d_getgrent_r_proto=define
13581 set d_getgrent_r_proto getgrent_r $hdrs
13585 case "$d_getgrent_r_proto" in
13587 case "$getgrent_r_proto" in
13588 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13589 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13591 case "$getgrent_r_proto" in
13592 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13593 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13595 case "$getgrent_r_proto" in
13596 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13597 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13599 case "$getgrent_r_proto" in
13600 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13601 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13603 case "$getgrent_r_proto" in
13604 ''|0) try='int getgrent_r(struct group*, char*, int);'
13605 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13607 case "$getgrent_r_proto" in
13608 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13609 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13611 case "$getgrent_r_proto" in
13612 ''|0) d_getgrent_r=undef
13614 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13615 * ) case "$getgrent_r_proto" in
13616 REENTRANT_PROTO*) ;;
13617 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13619 echo "Prototype: $try" ;;
13622 *) case "$usethreads" in
13623 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13630 *) getgrent_r_proto=0
13634 : see if getgrgid_r exists
13635 set getgrgid_r d_getgrgid_r
13637 case "$d_getgrgid_r" in
13639 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13640 case "$d_getgrgid_r_proto:$usethreads" in
13641 ":define") d_getgrgid_r_proto=define
13642 set d_getgrgid_r_proto getgrgid_r $hdrs
13646 case "$d_getgrgid_r_proto" in
13648 case "$getgrgid_r_proto" in
13649 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13650 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13652 case "$getgrgid_r_proto" in
13653 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13654 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13656 case "$getgrgid_r_proto" in
13657 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13658 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13660 case "$getgrgid_r_proto" in
13661 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13662 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13664 case "$getgrgid_r_proto" in
13665 ''|0) d_getgrgid_r=undef
13667 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13668 * ) case "$getgrgid_r_proto" in
13669 REENTRANT_PROTO*) ;;
13670 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13672 echo "Prototype: $try" ;;
13675 *) case "$usethreads" in
13676 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13683 *) getgrgid_r_proto=0
13687 : see if getgrnam_r exists
13688 set getgrnam_r d_getgrnam_r
13690 case "$d_getgrnam_r" in
13692 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13693 case "$d_getgrnam_r_proto:$usethreads" in
13694 ":define") d_getgrnam_r_proto=define
13695 set d_getgrnam_r_proto getgrnam_r $hdrs
13699 case "$d_getgrnam_r_proto" in
13701 case "$getgrnam_r_proto" in
13702 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13703 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13705 case "$getgrnam_r_proto" in
13706 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13707 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13709 case "$getgrnam_r_proto" in
13710 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13711 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13713 case "$getgrnam_r_proto" in
13714 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13715 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13717 case "$getgrnam_r_proto" in
13718 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13719 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13721 case "$getgrnam_r_proto" in
13722 ''|0) d_getgrnam_r=undef
13724 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13725 * ) case "$getgrnam_r_proto" in
13726 REENTRANT_PROTO*) ;;
13727 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13729 echo "Prototype: $try" ;;
13732 *) case "$usethreads" in
13733 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13740 *) getgrnam_r_proto=0
13744 : see if gethostbyaddr exists
13745 set gethostbyaddr d_gethbyaddr
13748 : see if gethostbyname exists
13749 set gethostbyname d_gethbyname
13752 : see if gethostent exists
13753 set gethostent d_gethent
13756 : see how we will look up host name
13759 if set gethostname val -f d_gethname; eval $csym; $val; then
13760 echo 'gethostname() found.' >&4
13761 d_gethname="$define"
13764 if set uname val -f d_uname; eval $csym; $val; then
13767 uname() was found, but you're running xenix, and older versions of xenix
13768 have a broken uname(). If you don't really know whether your xenix is old
13769 enough to have a broken system call, use the default answer.
13774 "$define") dflt=n;;
13776 rp='Is your uname() broken?'
13779 n*) d_uname="$define"; call=uname;;
13782 echo 'uname() found.' >&4
13789 case "$d_gethname" in
13790 '') d_gethname="$undef";;
13793 '') d_uname="$undef";;
13795 case "$d_uname$d_gethname" in
13800 Every now and then someone has a $call() that lies about the hostname
13801 but can't be fixed for political or economic reasons. If you wish, I can
13802 pretend $call() isn't there and maybe compute hostname at run-time
13803 thanks to the '$phostname' command.
13806 rp="Shall I ignore $call() from now on?"
13809 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13812 case "$phostname" in
13813 '') aphostname='';;
13814 *) case "$aphostname" in
13816 *) set X $phostname
13820 file=`./loc $file $file $pth`
13821 aphostname=`echo $file $*`
13826 case "$d_uname$d_gethname" in
13829 case "$phostname" in
13831 echo "There will be no way for $package to get your hostname." >&4;;
13833 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13837 case "$d_phostname" in
13838 '') d_phostname="$undef";;
13841 : see if gethostbyaddr_r exists
13842 set gethostbyaddr_r d_gethostbyaddr_r
13844 case "$d_gethostbyaddr_r" in
13846 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13847 case "$d_gethostbyaddr_r_proto:$usethreads" in
13848 ":define") d_gethostbyaddr_r_proto=define
13849 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13853 case "$d_gethostbyaddr_r_proto" in
13855 case "$gethostbyaddr_r_proto" in
13856 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13857 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13859 case "$gethostbyaddr_r_proto" in
13860 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13861 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13863 case "$gethostbyaddr_r_proto" in
13864 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13865 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13867 case "$gethostbyaddr_r_proto" in
13868 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13869 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13871 case "$gethostbyaddr_r_proto" in
13872 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13873 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13875 case "$gethostbyaddr_r_proto" in
13876 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13877 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13879 case "$gethostbyaddr_r_proto" in
13880 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13881 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13883 case "$gethostbyaddr_r_proto" in
13884 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13885 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13887 case "$gethostbyaddr_r_proto" in
13888 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13889 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13891 case "$gethostbyaddr_r_proto" in
13892 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13893 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13895 case "$gethostbyaddr_r_proto" in
13896 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13897 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13899 case "$gethostbyaddr_r_proto" in
13900 ''|0) d_gethostbyaddr_r=undef
13901 gethostbyaddr_r_proto=0
13902 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13903 * ) case "$gethostbyaddr_r_proto" in
13904 REENTRANT_PROTO*) ;;
13905 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13907 echo "Prototype: $try" ;;
13910 *) case "$usethreads" in
13911 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13913 d_gethostbyaddr_r=undef
13914 gethostbyaddr_r_proto=0
13918 *) gethostbyaddr_r_proto=0
13922 : see if gethostbyname_r exists
13923 set gethostbyname_r d_gethostbyname_r
13925 case "$d_gethostbyname_r" in
13927 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13928 case "$d_gethostbyname_r_proto:$usethreads" in
13929 ":define") d_gethostbyname_r_proto=define
13930 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13934 case "$d_gethostbyname_r_proto" in
13936 case "$gethostbyname_r_proto" in
13937 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13938 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13940 case "$gethostbyname_r_proto" in
13941 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13942 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13944 case "$gethostbyname_r_proto" in
13945 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13946 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13948 case "$gethostbyname_r_proto" in
13949 ''|0) d_gethostbyname_r=undef
13950 gethostbyname_r_proto=0
13951 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13952 * ) case "$gethostbyname_r_proto" in
13953 REENTRANT_PROTO*) ;;
13954 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13956 echo "Prototype: $try" ;;
13959 *) case "$usethreads" in
13960 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13962 d_gethostbyname_r=undef
13963 gethostbyname_r_proto=0
13967 *) gethostbyname_r_proto=0
13971 : see if gethostent_r exists
13972 set gethostent_r d_gethostent_r
13974 case "$d_gethostent_r" in
13976 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13977 case "$d_gethostent_r_proto:$usethreads" in
13978 ":define") d_gethostent_r_proto=define
13979 set d_gethostent_r_proto gethostent_r $hdrs
13983 case "$d_gethostent_r_proto" in
13985 case "$gethostent_r_proto" in
13986 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13987 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13989 case "$gethostent_r_proto" in
13990 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13991 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13993 case "$gethostent_r_proto" in
13994 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13995 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13997 case "$gethostent_r_proto" in
13998 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13999 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14001 case "$gethostent_r_proto" in
14002 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14003 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14005 case "$gethostent_r_proto" in
14006 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14007 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14009 case "$gethostent_r_proto" in
14010 ''|0) d_gethostent_r=undef
14011 gethostent_r_proto=0
14012 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14013 * ) case "$gethostent_r_proto" in
14014 REENTRANT_PROTO*) ;;
14015 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14017 echo "Prototype: $try" ;;
14020 *) case "$usethreads" in
14021 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14023 d_gethostent_r=undef
14024 gethostent_r_proto=0
14028 *) gethostent_r_proto=0
14032 : see if prototypes for various gethostxxx netdb.h functions are available
14034 set d_gethostprotos gethostent $i_netdb netdb.h
14037 : see if getitimer exists
14038 set getitimer d_getitimer
14041 : see if getlogin exists
14042 set getlogin d_getlogin
14045 : see if getlogin_r exists
14046 set getlogin_r d_getlogin_r
14048 case "$d_getlogin_r" in
14050 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14051 case "$d_getlogin_r_proto:$usethreads" in
14052 ":define") d_getlogin_r_proto=define
14053 set d_getlogin_r_proto getlogin_r $hdrs
14057 case "$d_getlogin_r_proto" in
14059 case "$getlogin_r_proto" in
14060 ''|0) try='int getlogin_r(char*, size_t);'
14061 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14063 case "$getlogin_r_proto" in
14064 ''|0) try='int getlogin_r(char*, int);'
14065 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14067 case "$getlogin_r_proto" in
14068 ''|0) try='char* getlogin_r(char*, size_t);'
14069 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14071 case "$getlogin_r_proto" in
14072 ''|0) try='char* getlogin_r(char*, int);'
14073 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14075 case "$getlogin_r_proto" in
14076 ''|0) d_getlogin_r=undef
14078 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14079 * ) case "$getlogin_r_proto" in
14080 REENTRANT_PROTO*) ;;
14081 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14083 echo "Prototype: $try" ;;
14086 *) case "$usethreads" in
14087 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14094 *) getlogin_r_proto=0
14098 : see if getmnt exists
14099 set getmnt d_getmnt
14102 : see if getmntent exists
14103 set getmntent d_getmntent
14106 : see if getnameinfo exists
14107 set getnameinfo d_getnameinfo
14110 : see if getnetbyaddr exists
14111 set getnetbyaddr d_getnbyaddr
14114 : see if getnetbyname exists
14115 set getnetbyname d_getnbyname
14118 : see if getnetent exists
14119 set getnetent d_getnent
14122 : see if getnetbyaddr_r exists
14123 set getnetbyaddr_r d_getnetbyaddr_r
14125 case "$d_getnetbyaddr_r" in
14127 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14128 case "$d_getnetbyaddr_r_proto:$usethreads" in
14129 ":define") d_getnetbyaddr_r_proto=define
14130 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14134 case "$d_getnetbyaddr_r_proto" in
14136 case "$getnetbyaddr_r_proto" in
14137 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14138 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14140 case "$getnetbyaddr_r_proto" in
14141 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14142 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14144 case "$getnetbyaddr_r_proto" in
14145 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14146 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14148 case "$getnetbyaddr_r_proto" in
14149 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14150 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14152 case "$getnetbyaddr_r_proto" in
14153 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14154 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14156 case "$getnetbyaddr_r_proto" in
14157 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14158 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14160 case "$getnetbyaddr_r_proto" in
14161 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14162 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14164 case "$getnetbyaddr_r_proto" in
14165 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14166 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14168 case "$getnetbyaddr_r_proto" in
14169 ''|0) d_getnetbyaddr_r=undef
14170 getnetbyaddr_r_proto=0
14171 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14172 * ) case "$getnetbyaddr_r_proto" in
14173 REENTRANT_PROTO*) ;;
14174 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14176 echo "Prototype: $try" ;;
14179 *) case "$usethreads" in
14180 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14182 d_getnetbyaddr_r=undef
14183 getnetbyaddr_r_proto=0
14187 *) getnetbyaddr_r_proto=0
14191 : see if getnetbyname_r exists
14192 set getnetbyname_r d_getnetbyname_r
14194 case "$d_getnetbyname_r" in
14196 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14197 case "$d_getnetbyname_r_proto:$usethreads" in
14198 ":define") d_getnetbyname_r_proto=define
14199 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14203 case "$d_getnetbyname_r_proto" in
14205 case "$getnetbyname_r_proto" in
14206 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14207 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14209 case "$getnetbyname_r_proto" in
14210 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14211 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14213 case "$getnetbyname_r_proto" in
14214 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14215 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14217 case "$getnetbyname_r_proto" in
14218 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14219 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14221 case "$getnetbyname_r_proto" in
14222 ''|0) d_getnetbyname_r=undef
14223 getnetbyname_r_proto=0
14224 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14225 * ) case "$getnetbyname_r_proto" in
14226 REENTRANT_PROTO*) ;;
14227 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14229 echo "Prototype: $try" ;;
14232 *) case "$usethreads" in
14233 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14235 d_getnetbyname_r=undef
14236 getnetbyname_r_proto=0
14240 *) getnetbyname_r_proto=0
14244 : see if getnetent_r exists
14245 set getnetent_r d_getnetent_r
14247 case "$d_getnetent_r" in
14249 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14250 case "$d_getnetent_r_proto:$usethreads" in
14251 ":define") d_getnetent_r_proto=define
14252 set d_getnetent_r_proto getnetent_r $hdrs
14256 case "$d_getnetent_r_proto" in
14258 case "$getnetent_r_proto" in
14259 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14260 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14262 case "$getnetent_r_proto" in
14263 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14264 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14266 case "$getnetent_r_proto" in
14267 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14268 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14270 case "$getnetent_r_proto" in
14271 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14272 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14274 case "$getnetent_r_proto" in
14275 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14276 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14278 case "$getnetent_r_proto" in
14279 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14280 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14282 case "$getnetent_r_proto" in
14283 ''|0) d_getnetent_r=undef
14284 getnetent_r_proto=0
14285 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14286 * ) case "$getnetent_r_proto" in
14287 REENTRANT_PROTO*) ;;
14288 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14290 echo "Prototype: $try" ;;
14293 *) case "$usethreads" in
14294 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14296 d_getnetent_r=undef
14297 getnetent_r_proto=0
14301 *) getnetent_r_proto=0
14305 : see if prototypes for various getnetxxx netdb.h functions are available
14307 set d_getnetprotos getnetent $i_netdb netdb.h
14310 : see if getpagesize exists
14311 set getpagesize d_getpagsz
14314 : Optional checks for getprotobyname and getprotobynumber
14316 : see if getprotobyname exists
14317 set getprotobyname d_getpbyname
14320 : see if getprotobynumber exists
14321 set getprotobynumber d_getpbynumber
14324 : see if getprotoent exists
14325 set getprotoent d_getpent
14328 : see if getpgid exists
14329 set getpgid d_getpgid
14332 : see if getpgrp2 exists
14333 set getpgrp2 d_getpgrp2
14336 : see if getppid exists
14337 set getppid d_getppid
14340 : see if getpriority exists
14341 set getpriority d_getprior
14344 : see if getprotobyname_r exists
14345 set getprotobyname_r d_getprotobyname_r
14347 case "$d_getprotobyname_r" in
14349 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14350 case "$d_getprotobyname_r_proto:$usethreads" in
14351 ":define") d_getprotobyname_r_proto=define
14352 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14356 case "$d_getprotobyname_r_proto" in
14358 case "$getprotobyname_r_proto" in
14359 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14360 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14362 case "$getprotobyname_r_proto" in
14363 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14364 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14366 case "$getprotobyname_r_proto" in
14367 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14368 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14370 case "$getprotobyname_r_proto" in
14371 ''|0) d_getprotobyname_r=undef
14372 getprotobyname_r_proto=0
14373 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14374 * ) case "$getprotobyname_r_proto" in
14375 REENTRANT_PROTO*) ;;
14376 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14378 echo "Prototype: $try" ;;
14381 *) case "$usethreads" in
14382 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14384 d_getprotobyname_r=undef
14385 getprotobyname_r_proto=0
14389 *) getprotobyname_r_proto=0
14393 : see if getprotobynumber_r exists
14394 set getprotobynumber_r d_getprotobynumber_r
14396 case "$d_getprotobynumber_r" in
14398 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14399 case "$d_getprotobynumber_r_proto:$usethreads" in
14400 ":define") d_getprotobynumber_r_proto=define
14401 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14405 case "$d_getprotobynumber_r_proto" in
14407 case "$getprotobynumber_r_proto" in
14408 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14409 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14411 case "$getprotobynumber_r_proto" in
14412 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14413 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14415 case "$getprotobynumber_r_proto" in
14416 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14417 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14419 case "$getprotobynumber_r_proto" in
14420 ''|0) d_getprotobynumber_r=undef
14421 getprotobynumber_r_proto=0
14422 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14423 * ) case "$getprotobynumber_r_proto" in
14424 REENTRANT_PROTO*) ;;
14425 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14427 echo "Prototype: $try" ;;
14430 *) case "$usethreads" in
14431 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14433 d_getprotobynumber_r=undef
14434 getprotobynumber_r_proto=0
14438 *) getprotobynumber_r_proto=0
14442 : see if getprotoent_r exists
14443 set getprotoent_r d_getprotoent_r
14445 case "$d_getprotoent_r" in
14447 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14448 case "$d_getprotoent_r_proto:$usethreads" in
14449 ":define") d_getprotoent_r_proto=define
14450 set d_getprotoent_r_proto getprotoent_r $hdrs
14454 case "$d_getprotoent_r_proto" in
14456 case "$getprotoent_r_proto" in
14457 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14458 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14460 case "$getprotoent_r_proto" in
14461 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14462 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14464 case "$getprotoent_r_proto" in
14465 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14466 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14468 case "$getprotoent_r_proto" in
14469 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14470 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14472 case "$getprotoent_r_proto" in
14473 ''|0) d_getprotoent_r=undef
14474 getprotoent_r_proto=0
14475 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14476 * ) case "$getprotoent_r_proto" in
14477 REENTRANT_PROTO*) ;;
14478 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14480 echo "Prototype: $try" ;;
14483 *) case "$usethreads" in
14484 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14486 d_getprotoent_r=undef
14487 getprotoent_r_proto=0
14491 *) getprotoent_r_proto=0
14495 : see if prototypes for various getprotoxxx netdb.h functions are available
14497 set d_getprotoprotos getprotoent $i_netdb netdb.h
14500 : see if getprpwnam exists
14501 set getprpwnam d_getprpwnam
14504 : see if getpwent exists
14505 set getpwent d_getpwent
14508 : see if getpwent_r exists
14509 set getpwent_r d_getpwent_r
14511 case "$d_getpwent_r" in
14513 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14514 case "$d_getpwent_r_proto:$usethreads" in
14515 ":define") d_getpwent_r_proto=define
14516 set d_getpwent_r_proto getpwent_r $hdrs
14520 case "$d_getpwent_r_proto" in
14522 case "$getpwent_r_proto" in
14523 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14524 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14526 case "$getpwent_r_proto" in
14527 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14528 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14530 case "$getpwent_r_proto" in
14531 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14532 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14534 case "$getpwent_r_proto" in
14535 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14536 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14538 case "$getpwent_r_proto" in
14539 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14540 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14542 case "$getpwent_r_proto" in
14543 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14544 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14546 case "$getpwent_r_proto" in
14547 ''|0) d_getpwent_r=undef
14549 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14550 * ) case "$getpwent_r_proto" in
14551 REENTRANT_PROTO*) ;;
14552 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14554 echo "Prototype: $try" ;;
14557 *) case "$usethreads" in
14558 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14565 *) getpwent_r_proto=0
14569 : see if getpwnam_r exists
14570 set getpwnam_r d_getpwnam_r
14572 case "$d_getpwnam_r" in
14574 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14575 case "$d_getpwnam_r_proto:$usethreads" in
14576 ":define") d_getpwnam_r_proto=define
14577 set d_getpwnam_r_proto getpwnam_r $hdrs
14581 case "$d_getpwnam_r_proto" in
14583 case "$getpwnam_r_proto" in
14584 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14585 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14587 case "$getpwnam_r_proto" in
14588 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14589 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14591 case "$getpwnam_r_proto" in
14592 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14593 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14595 case "$getpwnam_r_proto" in
14596 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14597 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14599 case "$getpwnam_r_proto" in
14600 ''|0) d_getpwnam_r=undef
14602 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14603 * ) case "$getpwnam_r_proto" in
14604 REENTRANT_PROTO*) ;;
14605 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14607 echo "Prototype: $try" ;;
14610 *) case "$usethreads" in
14611 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14618 *) getpwnam_r_proto=0
14622 : see if getpwuid_r exists
14623 set getpwuid_r d_getpwuid_r
14625 case "$d_getpwuid_r" in
14627 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14628 case "$d_getpwuid_r_proto:$usethreads" in
14629 ":define") d_getpwuid_r_proto=define
14630 set d_getpwuid_r_proto getpwuid_r $hdrs
14634 case "$d_getpwuid_r_proto" in
14636 case "$getpwuid_r_proto" in
14637 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14638 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14640 case "$getpwuid_r_proto" in
14641 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14642 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14644 case "$getpwuid_r_proto" in
14645 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14646 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14648 case "$getpwuid_r_proto" in
14649 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14650 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14652 case "$getpwuid_r_proto" in
14653 ''|0) d_getpwuid_r=undef
14655 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14656 * ) case "$getpwuid_r_proto" in
14657 REENTRANT_PROTO*) ;;
14658 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14660 echo "Prototype: $try" ;;
14663 *) case "$usethreads" in
14664 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14671 *) getpwuid_r_proto=0
14675 : Optional checks for getsbyname and getsbyport
14677 : see if getservbyname exists
14678 set getservbyname d_getsbyname
14681 : see if getservbyport exists
14682 set getservbyport d_getsbyport
14685 : see if getservent exists
14686 set getservent d_getsent
14689 : see if getservbyname_r exists
14690 set getservbyname_r d_getservbyname_r
14692 case "$d_getservbyname_r" in
14694 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14695 case "$d_getservbyname_r_proto:$usethreads" in
14696 ":define") d_getservbyname_r_proto=define
14697 set d_getservbyname_r_proto getservbyname_r $hdrs
14701 case "$d_getservbyname_r_proto" in
14703 case "$getservbyname_r_proto" in
14704 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14705 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14707 case "$getservbyname_r_proto" in
14708 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14709 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14711 case "$getservbyname_r_proto" in
14712 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14713 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14715 case "$getservbyname_r_proto" in
14716 ''|0) d_getservbyname_r=undef
14717 getservbyname_r_proto=0
14718 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14719 * ) case "$getservbyname_r_proto" in
14720 REENTRANT_PROTO*) ;;
14721 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14723 echo "Prototype: $try" ;;
14726 *) case "$usethreads" in
14727 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14729 d_getservbyname_r=undef
14730 getservbyname_r_proto=0
14734 *) getservbyname_r_proto=0
14738 : see if getservbyport_r exists
14739 set getservbyport_r d_getservbyport_r
14741 case "$d_getservbyport_r" in
14743 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14744 case "$d_getservbyport_r_proto:$usethreads" in
14745 ":define") d_getservbyport_r_proto=define
14746 set d_getservbyport_r_proto getservbyport_r $hdrs
14750 case "$d_getservbyport_r_proto" in
14752 case "$getservbyport_r_proto" in
14753 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14754 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14756 case "$getservbyport_r_proto" in
14757 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14758 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14760 case "$getservbyport_r_proto" in
14761 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14762 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14764 case "$getservbyport_r_proto" in
14765 ''|0) d_getservbyport_r=undef
14766 getservbyport_r_proto=0
14767 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14768 * ) case "$getservbyport_r_proto" in
14769 REENTRANT_PROTO*) ;;
14770 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14772 echo "Prototype: $try" ;;
14775 *) case "$usethreads" in
14776 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14778 d_getservbyport_r=undef
14779 getservbyport_r_proto=0
14783 *) getservbyport_r_proto=0
14787 : see if getservent_r exists
14788 set getservent_r d_getservent_r
14790 case "$d_getservent_r" in
14792 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14793 case "$d_getservent_r_proto:$usethreads" in
14794 ":define") d_getservent_r_proto=define
14795 set d_getservent_r_proto getservent_r $hdrs
14799 case "$d_getservent_r_proto" in
14801 case "$getservent_r_proto" in
14802 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14803 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14805 case "$getservent_r_proto" in
14806 ''|0) try='int getservent_r(struct servent*, char*, int);'
14807 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14809 case "$getservent_r_proto" in
14810 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14811 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14813 case "$getservent_r_proto" in
14814 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14815 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14817 case "$getservent_r_proto" in
14818 ''|0) d_getservent_r=undef
14819 getservent_r_proto=0
14820 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14821 * ) case "$getservent_r_proto" in
14822 REENTRANT_PROTO*) ;;
14823 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14825 echo "Prototype: $try" ;;
14828 *) case "$usethreads" in
14829 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14831 d_getservent_r=undef
14832 getservent_r_proto=0
14836 *) getservent_r_proto=0
14840 : see if prototypes for various getservxxx netdb.h functions are available
14842 set d_getservprotos getservent $i_netdb netdb.h
14845 : see if getspnam exists
14846 set getspnam d_getspnam
14849 : see if this is a shadow.h system
14850 set shadow.h i_shadow
14853 : see if getspnam_r exists
14854 set getspnam_r d_getspnam_r
14856 case "$d_getspnam_r" in
14858 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14859 case "$d_getspnam_r_proto:$usethreads" in
14860 ":define") d_getspnam_r_proto=define
14861 set d_getspnam_r_proto getspnam_r $hdrs
14865 case "$d_getspnam_r_proto" in
14867 case "$getspnam_r_proto" in
14868 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14869 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14871 case "$getspnam_r_proto" in
14872 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14873 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14875 case "$getspnam_r_proto" in
14876 ''|0) d_getspnam_r=undef
14878 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14879 * ) case "$getspnam_r_proto" in
14880 REENTRANT_PROTO*) ;;
14881 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14883 echo "Prototype: $try" ;;
14886 *) case "$usethreads" in
14887 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14894 *) getspnam_r_proto=0
14898 : see if gettimeofday or ftime exists
14899 set gettimeofday d_gettimeod
14901 case "$d_gettimeod" in
14907 val="$undef"; set d_ftime; eval $setvar
14910 case "$d_gettimeod$d_ftime" in
14913 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14917 : see if gmtime_r exists
14918 set gmtime_r d_gmtime_r
14920 case "$d_gmtime_r" in
14922 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14923 case "$d_gmtime_r_proto:$usethreads" in
14924 ":define") d_gmtime_r_proto=define
14925 set d_gmtime_r_proto gmtime_r $hdrs
14929 case "$d_gmtime_r_proto" in
14931 case "$gmtime_r_proto" in
14932 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14933 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14935 case "$gmtime_r_proto" in
14936 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14937 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14939 case "$gmtime_r_proto" in
14940 ''|0) d_gmtime_r=undef
14942 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14943 * ) case "$gmtime_r_proto" in
14944 REENTRANT_PROTO*) ;;
14945 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14947 echo "Prototype: $try" ;;
14950 *) case "$usethreads" in
14951 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14958 *) gmtime_r_proto=0
14962 : see if hasmntopt exists
14963 set hasmntopt d_hasmntopt
14966 : see if this is a netinet/in.h or sys/in.h system
14967 set netinet/in.h i_niin sys/in.h i_sysin
14970 : see if arpa/inet.h has to be included
14971 set arpa/inet.h i_arpainet
14974 : see if htonl --and friends-- exists
14979 : Maybe they are macros.
14982 $cat >htonl.c <<EOM
14984 #include <sys/types.h>
14985 #$i_niin I_NETINET_IN
14987 #$i_arpainet I_ARPA_INET
14988 #ifdef I_NETINET_IN
14989 #include <netinet/in.h>
14992 #include <sys/in.h>
14995 #include <arpa/inet.h>
14998 printf("Defined as a macro.");
15001 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15002 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15004 echo "But it seems to be defined as a macro." >&4
15012 : see if ilogbl exists
15013 set ilogbl d_ilogbl
15018 if set index val -f; eval $csym; $val; then
15019 if set strchr val -f d_strchr; eval $csym; $val; then
15020 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15023 echo "strchr() found." >&4
15027 echo "index() found." >&4
15032 echo "index() found." >&4
15035 if set strchr val -f d_strchr; eval $csym; $val; then
15038 echo "strchr() found." >&4
15040 echo "No index() or strchr() found!" >&4
15045 set d_strchr; eval $setvar
15047 set d_index; eval $setvar
15049 : check whether inet_aton exists
15050 set inet_aton d_inetaton
15053 : see if inet_ntop exists
15054 set inet_ntop d_inetntop
15057 : see if inet_pton exists
15058 set inet_pton d_inetpton
15063 $cat >isascii.c <<EOCP
15066 #$i_stdlib I_STDLIB
15068 #include <stdlib.h>
15079 if eval $compile; then
15080 echo "isascii() found." >&4
15083 echo "isascii() NOT found." >&4
15092 $cat >isblank.c <<'EOCP'
15103 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15104 echo "isblank() found." >&4
15107 echo "isblank() NOT found." >&4
15114 : see if isfinite exists
15115 set isfinite d_isfinite
15118 : see if isinf exists
15122 : see if isnan exists
15126 : see if isnanl exists
15127 set isnanl d_isnanl
15130 : see if killpg exists
15131 set killpg d_killpg
15134 : see if lchown exists
15136 $cat > try.c <<'EOCP'
15137 /* System header to define __stub macros and hopefully few prototypes,
15138 which can conflict with char lchown(); below. */
15139 #include <assert.h>
15140 /* Override any gcc2 internal prototype to avoid an error. */
15141 /* We use char because int might match the return type of a gcc2
15142 builtin and then its argument prototype would still apply. */
15145 /* The GNU C library defines this for functions which it implements
15146 to always fail with ENOSYS. Some functions are actually named
15147 something starting with __ and the normal name is an alias. */
15148 #if defined (__stub_lchown) || defined (__stub___lchown)
15156 if eval $compile; then
15157 $echo "lchown() found." >&4
15160 $echo "lchown() NOT found." >&4
15166 : See if number of significant digits in a double precision number is known
15168 $cat >ldbl_dig.c <<EOM
15169 #$i_limits I_LIMITS
15172 #include <limits.h>
15178 printf("Contains LDBL_DIG");
15181 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15182 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15183 echo "LDBL_DIG found." >&4
15186 echo "LDBL_DIG NOT found." >&4
15193 : see if this is a math.h system
15197 : check to see if math.h defines _LIB_VERSION
15198 d_libm_lib_version="$undef"
15202 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15204 #include <unistd.h>
15206 int main (int argc, char *argv[])
15208 printf ("%d\n", _LIB_VERSION);
15213 if eval $compile; then
15215 echo "Yes, it does ($foo)" >&4
15216 d_libm_lib_version="$define"
15218 echo "No, it does not (probably harmless)" >&4
15225 : see if link exists
15229 : see if localtime_r exists
15230 set localtime_r d_localtime_r
15232 case "$d_localtime_r" in
15234 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15235 case "$d_localtime_r_proto:$usethreads" in
15236 ":define") d_localtime_r_proto=define
15237 set d_localtime_r_proto localtime_r $hdrs
15241 case "$d_localtime_r_proto" in
15243 case "$localtime_r_proto" in
15244 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15245 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15247 case "$localtime_r_proto" in
15248 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15249 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15251 case "$localtime_r_proto" in
15252 ''|0) d_localtime_r=undef
15253 localtime_r_proto=0
15254 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15255 * ) case "$localtime_r_proto" in
15256 REENTRANT_PROTO*) ;;
15257 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15259 echo "Prototype: $try" ;;
15262 *) case "$usethreads" in
15263 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15265 d_localtime_r=undef
15266 localtime_r_proto=0
15270 *) localtime_r_proto=0
15274 : see if localtime_r calls tzset
15275 case "$localtime_r_proto" in
15278 /* Does our libc's localtime_r call tzset ?
15279 * return 0 if so, 1 otherwise.
15281 #$i_systypes I_SYS_TYPES
15282 #$i_unistd I_UNISTD
15284 #$i_stdlib I_STDLIB
15285 #$i_string I_STRING
15286 #$i_malloc I_MALLOC
15288 # include <sys/types.h>
15291 # include <unistd.h>
15297 #include <stdlib.h>
15300 # include <string.h>
15302 # include <strings.h>
15305 # include <malloc.h>
15309 time_t t = time(0L);
15310 char w_tz[]="TZ" "=GMT+5",
15311 e_tz[]="TZ" "=GMT-5",
15312 *tz_e = (char*)malloc(16),
15313 *tz_w = (char*)malloc(16);
15314 struct tm tm_e, tm_w;
15315 memset(&tm_e,'\0',sizeof(struct tm));
15316 memset(&tm_w,'\0',sizeof(struct tm));
15321 localtime_r(&t, &tm_e);
15324 localtime_r(&t, &tm_w);
15326 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15332 if eval $compile; then
15333 if $run ./try; then
15334 d_localtime_r_needs_tzset=undef;
15336 d_localtime_r_needs_tzset=define;
15339 d_localtime_r_needs_tzset=undef;
15343 d_localtime_r_needs_tzset=undef;
15348 : see if localeconv exists
15349 set localeconv d_locconv
15352 : see if lockf exists
15356 : see if prototype for lseek is available
15358 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15361 : see if lstat exists
15365 : see if madvise exists
15366 set madvise d_madvise
15369 : see if malloc_size exists
15370 set malloc_size d_malloc_size
15373 : see if malloc_size_good exists
15374 set malloc_good_size d_malloc_good_size
15377 : see if mblen exists
15381 : see if mbstowcs exists
15382 set mbstowcs d_mbstowcs
15385 : see if mbtowc exists
15386 set mbtowc d_mbtowc
15389 : see if memchr exists
15390 set memchr d_memchr
15393 : see if memcmp exists
15394 set memcmp d_memcmp
15397 : see if memcpy exists
15398 set memcpy d_memcpy
15401 : see if memmove exists
15402 set memmove d_memmove
15405 : see if memset exists
15406 set memset d_memset
15409 : see if mkdir exists
15413 : see if mkdtemp exists
15414 set mkdtemp d_mkdtemp
15417 : see if mkfifo exists
15418 set mkfifo d_mkfifo
15421 : see if mkstemp exists
15422 set mkstemp d_mkstemp
15425 : see if mkstemps exists
15426 set mkstemps d_mkstemps
15429 : see if mktime exists
15430 set mktime d_mktime
15433 : see if this is a sys/mman.h system
15434 set sys/mman.h i_sysmman
15437 : see if mmap exists
15440 : see what shmat returns
15441 : default to something harmless
15443 case "$i_sysmman$d_mmap" in
15445 $cat >mmap.c <<'END'
15446 #include <sys/mman.h>
15449 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15454 echo "and it returns ($mmaptype)." >&4
15460 : see if sqrtl exists
15464 : see if scalbnl exists
15465 set scalbnl d_scalbnl
15468 : see if modfl exists
15472 : see if prototype for modfl is available
15474 set d_modflproto modfl $i_math math.h
15477 d_modfl_pow32_bug="$undef"
15479 case "$d_longdbl$d_modfl" in
15482 Checking to see whether your modfl() is okay for large values...
15488 if $test "X$d_modflproto" != "X$define"; then
15489 $cat >>try.c <<EOCP
15490 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15491 long double modfl (long double, long double *);
15494 $cat >>try.c <<EOCP
15496 long double nv = 4294967303.15;
15502 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15506 case "$osname:$gccversion" in
15507 aix:) saveccflags="$ccflags"
15508 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15511 if eval $compile; then
15514 *" 4294967303.150000 1.150000 4294967302.000000")
15515 echo >&4 "Your modfl() is broken for large values."
15516 d_modfl_pow32_bug="$define"
15518 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15522 *" 4294967303.150000 0.150000 4294967303.000000")
15523 echo >&4 "Your modfl() seems okay for large values."
15525 *) echo >&4 "I don't understand your modfl() at all."
15531 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15534 case "$osname:$gccversion" in
15535 aix:) ccflags="$saveccflags" ;; # restore
15540 if $test "$uselongdouble" = "$define"; then
15542 if $test "$d_sqrtl" != "$define"; then
15543 message="$message sqrtl"
15545 if $test "$d_modfl" != "$define"; then
15546 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15547 echo "You have both aintl and copysignl, so I can emulate modfl."
15549 message="$message modfl"
15552 if $test "$d_frexpl" != "$define"; then
15553 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15554 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15556 message="$message frexpl"
15560 if $test "$message" != ""; then
15563 *** You requested the use of long doubles but you do not seem to have
15564 *** the following mathematical functions needed for long double support:
15566 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15567 *** Cannot continue, aborting.
15575 : see if mprotect exists
15576 set mprotect d_mprotect
15579 : see if msgctl exists
15580 set msgctl d_msgctl
15583 : see if msgget exists
15584 set msgget d_msgget
15587 : see if msgsnd exists
15588 set msgsnd d_msgsnd
15591 : see if msgrcv exists
15592 set msgrcv d_msgrcv
15595 : see how much of the 'msg*(2)' library is present.
15598 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15599 *"$undef"*) h_msg=false;;
15603 case "`ipcs 2>&1`" in
15604 "SVID messages"*"not configured"*)
15605 echo "Your $osname does not have the msg*(2) configured." >&4
15608 set msgctl d_msgctl
15610 set msgget d_msgget
15612 set msgsnd d_msgsnd
15614 set msgrcv d_msgrcv
15620 : we could also check for sys/ipc.h ...
15621 if $h_msg && $test `./findhdr sys/msg.h`; then
15622 echo "You have the full msg*(2) library." >&4
15625 echo "You don't have the full msg*(2) library." >&4
15631 : Check for msghdr_s
15633 echo "Checking to see if your system supports struct msghdr..." >&4
15634 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15636 case "$d_msghdr_s" in
15637 "$define") echo "Yes, it does." ;;
15638 *) echo "No, it doesn't." ;;
15642 : see if msync exists
15646 : see if munmap exists
15647 set munmap d_munmap
15650 : see if nice exists
15654 : see if this is a langinfo.h system
15655 set langinfo.h i_langinfo
15658 : see if nl_langinfo exists
15659 set nl_langinfo d_nl_langinfo
15662 : check for volatile keyword
15664 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15665 $cat >try.c <<'EOCP'
15668 typedef struct _goo_struct goo_struct;
15669 goo_struct * volatile goo = ((goo_struct *)0);
15670 struct _goo_struct {
15675 typedef unsigned short foo_t;
15676 char *volatile foo;
15678 volatile foo_t blech;
15682 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15684 echo "Yup, it does."
15687 echo "Nope, it doesn't."
15693 : Check basic sizes
15695 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15697 case "$use64bitint:$d_quad:$quadtype" in
15700 uvtype="$uquadtype"
15705 uvtype="unsigned long"
15711 case "$uselongdouble:$d_longdbl" in
15713 nvtype="long double"
15714 nvsize=$longdblsize
15721 $echo "(IV will be "$ivtype", $ivsize bytes)"
15722 $echo "(UV will be "$uvtype", $uvsize bytes)"
15723 $echo "(NV will be "$nvtype", $nvsize bytes)"
15726 #$i_inttypes I_INTTYPES
15728 #include <inttypes.h>
15733 int8_t i = INT8_MAX;
15734 uint8_t u = UINT8_MAX;
15735 printf("int8_t\n");
15738 int16_t i = INT16_MAX;
15739 uint16_t i = UINT16_MAX;
15740 printf("int16_t\n");
15743 int32_t i = INT32_MAX;
15744 uint32_t u = UINT32_MAX;
15745 printf("int32_t\n");
15750 i8type="signed char"
15751 u8type="unsigned char"
15756 '') case "$shortsize" in
15758 u16type="unsigned short"
15766 '') set try -DINT16
15767 if eval $compile; then
15768 case "`$run ./try`" in
15780 '') if $test $shortsize -ge 2; then
15782 u16type="unsigned short"
15790 '') case "$longsize" in
15792 u32type="unsigned long"
15796 *) case "$intsize" in
15798 u32type="unsigned int"
15808 '') set try -DINT32
15809 if eval $compile; then
15810 case "`$run ./try`" in
15822 '') if $test $intsize -ge 4; then
15824 u32type="unsigned int"
15832 '') case "$d_quad:$quadtype" in
15834 i64type="$quadtype"
15835 u64type="$uquadtype"
15843 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15844 : volatile so that the compiler has to store it out to memory.
15845 if test X"$d_volatile" = X"$define"; then
15850 #$i_stdlib I_STDLIB
15852 #include <stdlib.h>
15854 #include <sys/types.h>
15855 #include <signal.h>
15857 $volatile int bletched = 0;
15858 $signal_t blech(int s) { bletched = 1; }
15863 int n = 8 * $uvsize;
15866 signal(SIGFPE, blech);
15869 for (i = 0; i < n; i++) {
15870 u = u << 1 | ($uvtype)1;
15872 if (($uvtype)d != u)
15876 d = ($nvtype)(u - 1);
15877 if (($uvtype)d != (u - 1))
15884 printf("%d\n", ((i == n) ? -n : i));
15890 d_nv_preserves_uv="$undef"
15891 if eval $compile; then
15892 nv_preserves_uv_bits="`$run ./try`"
15894 case "$nv_preserves_uv_bits" in
15896 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15897 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15898 d_nv_preserves_uv="$define"
15900 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15901 d_nv_preserves_uv="$undef" ;;
15902 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15903 nv_preserves_uv_bits="0" ;;
15907 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15908 : volatile so that the compiler has to store it out to memory.
15909 if test X"$d_volatile" = X"$define"; then
15915 typedef $nvtype NV;
15922 while(count < 256) {
15923 $volatile NV up = value + 1.0;
15924 $volatile NV negated = -value;
15925 $volatile NV down = negated - 1.0;
15926 $volatile NV got_up = up - value;
15927 int up_good = got_up == 1.0;
15928 int got_down = down - negated;
15929 int down_good = got_down == -1.0;
15931 if (down_good != up_good) {
15933 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15934 up_good, (double) got_up, down_good, (double) got_down,
15935 count, (double) value);
15942 fputs("256.0", stdout);
15945 fputs("2.0", stdout);
15951 fputs("*", stdout);
15957 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15958 count, (double) value);
15964 nv_overflows_integers_at='0'
15965 if eval $compile; then
15971 The largest integer your NVs can preserve is equal to $xxx
15973 nv_overflows_integers_at="$xxx"
15976 Cannot determine the largest integer value your NVs can hold, unexpected output
15983 Cannot determine the largest integer value your NVs can hold
15990 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15991 : volatile so that the compiler has to store it out to memory.
15992 if test X"$d_volatile" = X"$define"; then
15997 #$i_stdlib I_STDLIB
15999 #include <stdlib.h>
16001 #$i_string I_STRING
16003 # include <string.h>
16005 # include <strings.h>
16007 #include <sys/types.h>
16008 #include <signal.h>
16010 $volatile int bletched = 0;
16011 $signal_t blech(int s) { bletched = 1; }
16014 int checkit($nvtype d, char *where) {
16015 unsigned char *p = (char *)&d;
16016 unsigned char *end = p + sizeof(d);
16026 printf("No - %s: 0x", where);
16028 printf ("%02X", *p++);
16033 int main(int argc, char **argv) {
16036 fail += checkit(d, "0.0");
16038 /* The compiler shouldn't be assuming that bletched is 0 */
16041 fail += checkit(d, "bleched");
16044 signal(SIGFPE, blech);
16047 /* Paranoia - the compiler should have no way of knowing that ANSI says
16048 that argv[argc] will always be NULL. Actually, if it did assume this it
16049 would be buggy, as this is C and main() can be called from elsewhere in
16051 d = argv[argc] ? 1 : 0;
16054 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16057 fail += checkit(d, "ternary");
16059 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16062 printf("No - memset doesn't give 0.0\n");
16063 /* This might just blow up: */
16064 printf("(gives %g)\n", d);
16070 printf("No - something bleched\n");
16075 printf("No - %d fail(s)\n", fail);
16084 d_nv_zero_is_allbits_zero="$undef"
16085 if eval $compile; then
16091 0.0 is represented as all bits zero in memory
16093 d_nv_zero_is_allbits_zero="$define"
16096 0.0 is not represented as all bits zero in memory
16098 d_nv_zero_is_allbits_zero="$undef"
16103 0.0 is not represented as all bits zero in memory
16105 d_nv_zero_is_allbits_zero="$undef"
16111 : check for off64_t
16113 echo "Checking to see if you have off64_t..." >&4
16115 #include <sys/types.h>
16116 #include <unistd.h>
16117 int main() { off64_t x = 7; }
16120 if eval $compile; then
16122 echo "You have off64_t."
16125 echo "You do not have off64_t."
16126 case "$lseeksize" in
16127 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16134 : how to create joinable pthreads
16135 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16137 echo "Checking what constant to use for creating joinable pthreads..." >&4
16138 $cat >try.c <<'EOCP'
16139 #include <pthread.h>
16141 int detachstate = JOINABLE;
16144 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16145 if eval $compile; then
16146 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16147 val="$undef" # Yes, undef.
16148 set d_old_pthread_create_joinable
16151 set old_pthread_create_joinable
16154 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16155 if eval $compile; then
16156 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16158 set d_old_pthread_create_joinable
16160 val=PTHREAD_CREATE_UNDETACHED
16161 set old_pthread_create_joinable
16164 set try -DJOINABLE=__UNDETACHED
16165 if eval $compile; then
16166 echo "You seem to use __UNDETACHED." >&4
16168 set d_old_pthread_create_joinable
16171 set old_pthread_create_joinable
16174 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16176 set d_old_pthread_create_joinable
16179 set old_pthread_create_joinable
16186 d_old_pthread_create_joinable="$undef"
16187 old_pthread_create_joinable=""
16190 : see if pause exists
16194 : see if poll exists
16198 : see if prctl exists
16202 : see if prctl supports PR_SET_NAME
16203 d_prctl_set_name=$undef
16207 #include <sys/prctl.h>
16209 int main (int argc, char *argv[])
16211 return (prctl (PR_SET_NAME, "Test"));
16215 if eval $compile_ok && $run ./try; then
16216 echo "Your prctl (PR_SET_NAME, ...) works"
16217 d_prctl_set_name=$define
16223 : see if readlink exists
16224 set readlink d_readlink
16227 : Check if exe is symlink to abs path of executing program
16231 case "$d_readlink" in
16233 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16234 : more tidy to avoid an extra level of symlink
16235 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16236 while test $# -gt 0; do
16239 if $issymlink $try; then
16240 $ls -l $try > reflect
16241 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16242 echo "You have $type-like $try."
16243 procselfexe='"'$try'"'
16245 : This will break out of the loop
16256 : backward compatibility for d_hvfork
16257 if test X$d_hvfork != X; then
16258 d_vfork="$d_hvfork"
16261 : see if there is a vfork
16266 d_pseudofork=$undef
16268 : Ok, but do we want to use it. vfork is reportedly unreliable in
16269 : perl on Solaris 2.x, and probably elsewhere.
16273 case "$usevfork" in
16279 Perl can only use a vfork() that doesn't suffer from strict
16280 restrictions on calling functions or modifying global data in
16281 the child. For example, glibc-2.1 contains such a vfork()
16282 that is unsuitable. If your system provides a proper fork()
16283 call, chances are that you do NOT want perl to use vfork().
16286 rp="Do you still want to use vfork()?"
16291 echo "Ok, we won't use vfork()."
16300 $define) usevfork='true';;
16301 *) usevfork='false';;
16304 : see whether the pthread_atfork exists
16306 #include <pthread.h>
16309 #ifdef PTHREAD_ATFORK
16310 pthread_atfork(NULL,NULL,NULL);
16315 : see if pthread_atfork exists
16316 set try -DPTHREAD_ATFORK
16317 if eval $compile; then
16322 case "$usethreads" in
16325 $define) echo 'pthread_atfork found.' >&4 ;;
16326 *) echo 'pthread_atfork NOT found.' >&4 ;;
16329 set d_pthread_atfork
16332 : see if pthread_attr_setscope exists
16333 set pthread_attr_setscope d_pthread_attr_setscope
16336 : see whether the various POSIXish _yields exist
16338 #include <pthread.h>
16344 #ifdef PTHREAD_YIELD
16347 #ifdef PTHREAD_YIELD_NULL
16348 pthread_yield(NULL);
16354 : see if sched_yield exists
16355 set try -DSCHED_YIELD
16356 if eval $compile; then
16358 sched_yield='sched_yield()'
16362 case "$usethreads" in
16365 $define) echo 'sched_yield() found.' >&4 ;;
16366 *) echo 'sched_yield() NOT found.' >&4 ;;
16372 : see if pthread_yield exists
16373 set try -DPTHREAD_YIELD
16374 if eval $compile; then
16376 case "$sched_yield" in
16377 '') sched_yield='pthread_yield()' ;;
16380 set try -DPTHREAD_YIELD_NULL
16381 if eval $compile; then
16383 case "$sched_yield" in
16384 '') sched_yield='pthread_yield(NULL)' ;;
16390 case "$usethreads" in
16393 $define) echo 'pthread_yield() found.' >&4 ;;
16394 *) echo 'pthread_yield() NOT found.' >&4 ;;
16398 set d_pthread_yield
16400 case "$sched_yield" in
16401 '') sched_yield=undef ;;
16405 : see if random_r exists
16406 set random_r d_random_r
16408 case "$d_random_r" in
16410 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16411 case "$d_random_r_proto:$usethreads" in
16412 ":define") d_random_r_proto=define
16413 set d_random_r_proto random_r $hdrs
16417 case "$d_random_r_proto" in
16419 case "$random_r_proto" in
16420 ''|0) try='int random_r(int*, struct random_data*);'
16421 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16423 case "$random_r_proto" in
16424 ''|0) try='int random_r(long*, struct random_data*);'
16425 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16427 case "$random_r_proto" in
16428 ''|0) try='int random_r(struct random_data*, int32_t*);'
16429 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16431 case "$random_r_proto" in
16432 ''|0) d_random_r=undef
16434 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16435 * ) case "$random_r_proto" in
16436 REENTRANT_PROTO*) ;;
16437 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16439 echo "Prototype: $try" ;;
16442 *) case "$usethreads" in
16443 define) echo "random_r has no prototype, not using it." >&4 ;;
16450 *) random_r_proto=0
16454 : see if readdir and friends exist
16455 set readdir d_readdir
16457 set seekdir d_seekdir
16459 set telldir d_telldir
16461 set rewinddir d_rewinddir
16464 : see if readdir64_r exists
16465 set readdir64_r d_readdir64_r
16467 case "$d_readdir64_r" in
16469 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16470 case "$d_readdir64_r_proto:$usethreads" in
16471 ":define") d_readdir64_r_proto=define
16472 set d_readdir64_r_proto readdir64_r $hdrs
16476 case "$d_readdir64_r_proto" in
16478 case "$readdir64_r_proto" in
16479 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16480 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16482 case "$readdir64_r_proto" in
16483 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16484 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16486 case "$readdir64_r_proto" in
16487 ''|0) d_readdir64_r=undef
16488 readdir64_r_proto=0
16489 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16490 * ) case "$readdir64_r_proto" in
16491 REENTRANT_PROTO*) ;;
16492 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16494 echo "Prototype: $try" ;;
16497 *) case "$usethreads" in
16498 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16500 d_readdir64_r=undef
16501 readdir64_r_proto=0
16505 *) readdir64_r_proto=0
16509 : see if readdir_r exists
16510 set readdir_r d_readdir_r
16512 case "$d_readdir_r" in
16514 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16515 case "$d_readdir_r_proto:$usethreads" in
16516 ":define") d_readdir_r_proto=define
16517 set d_readdir_r_proto readdir_r $hdrs
16521 case "$d_readdir_r_proto" in
16523 case "$readdir_r_proto" in
16524 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16525 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16527 case "$readdir_r_proto" in
16528 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16529 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16531 case "$readdir_r_proto" in
16532 ''|0) d_readdir_r=undef
16534 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16535 * ) case "$readdir_r_proto" in
16536 REENTRANT_PROTO*) ;;
16537 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16539 echo "Prototype: $try" ;;
16542 *) case "$usethreads" in
16543 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16550 *) readdir_r_proto=0
16554 : see if readv exists
16558 : see if recvmsg exists
16559 set recvmsg d_recvmsg
16562 : see if rename exists
16563 set rename d_rename
16566 : see if rmdir exists
16570 : see if memory.h is available.
16575 : See if it conflicts with string.h
16581 $cppstdin $cppflags $cppminus < $strings > mem.h
16582 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16584 echo "We won't be including <memory.h>."
16594 : can bcopy handle overlapping blocks?
16597 case "$d_memmove" in
16598 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16599 *) case "$d_bcopy" in
16601 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16603 #$i_memory I_MEMORY
16604 #$i_stdlib I_STDLIB
16605 #$i_string I_STRING
16606 #$i_unistd I_UNISTD
16608 $cat >>try.c <<'EOCP'
16611 # include <memory.h>
16614 # include <stdlib.h>
16617 # include <string.h>
16619 # include <strings.h>
16622 # include <unistd.h> /* Needed for NetBSD */
16626 char buf[128], abc[128];
16632 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16633 try to store the string in read-only memory. */
16634 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16636 for (align = 7; align >= 0; align--) {
16637 for (len = 36; len; len--) {
16639 bcopy(abc, b, len);
16640 for (off = 1; off <= len; off++) {
16641 bcopy(b, b+off, len);
16642 bcopy(b+off, b, len);
16643 if (bcmp(b, abc, len))
16652 if eval $compile_ok; then
16653 if $run ./try 2>/dev/null; then
16654 echo "Yes, it can."
16657 echo "It can't, sorry."
16660 echo "(I can't compile the test program, so we'll assume not...)"
16670 : can memcpy handle overlapping blocks?
16673 case "$d_memmove" in
16674 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16675 *) case "$d_memcpy" in
16677 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16679 #$i_memory I_MEMORY
16680 #$i_stdlib I_STDLIB
16681 #$i_string I_STRING
16682 #$i_unistd I_UNISTD
16684 $cat >>try.c <<'EOCP'
16687 # include <memory.h>
16690 # include <stdlib.h>
16693 # include <string.h>
16695 # include <strings.h>
16698 # include <unistd.h> /* Needed for NetBSD */
16702 char buf[128], abc[128];
16708 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16709 try to store the string in read-only memory. */
16710 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16712 for (align = 7; align >= 0; align--) {
16713 for (len = 36; len; len--) {
16715 memcpy(b, abc, len);
16716 for (off = 1; off <= len; off++) {
16717 memcpy(b+off, b, len);
16718 memcpy(b, b+off, len);
16719 if (memcmp(b, abc, len))
16728 if eval $compile_ok; then
16729 if $run ./try 2>/dev/null; then
16730 echo "Yes, it can."
16733 echo "It can't, sorry."
16736 echo "(I can't compile the test program, so we'll assume not...)"
16746 : can memcmp be trusted to compare relative magnitude?
16748 case "$d_memcmp" in
16751 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16753 #$i_memory I_MEMORY
16754 #$i_stdlib I_STDLIB
16755 #$i_string I_STRING
16756 #$i_unistd I_UNISTD
16758 $cat >>try.c <<'EOCP'
16761 # include <memory.h>
16764 # include <stdlib.h>
16767 # include <string.h>
16769 # include <strings.h>
16772 # include <unistd.h> /* Needed for NetBSD */
16778 if ((a < b) && memcmp(&a, &b, 1) < 0)
16784 if eval $compile_ok; then
16785 if $run ./try 2>/dev/null; then
16786 echo "Yes, it can."
16789 echo "No, it can't (it uses signed chars)."
16792 echo "(I can't compile the test program, so we'll assume not...)"
16800 : see if prototype for sbrk is available
16802 set d_sbrkproto sbrk $i_unistd unistd.h
16805 : see if select exists
16806 set select d_select
16809 : see if semctl exists
16810 set semctl d_semctl
16813 : see if semget exists
16814 set semget d_semget
16817 : see if semop exists
16821 : see how much of the 'sem*(2)' library is present.
16824 case "$d_semctl$d_semget$d_semop" in
16825 *"$undef"*) h_sem=false;;
16829 case "`ipcs 2>&1`" in
16830 "SVID messages"*"not configured"*)
16831 echo "Your $osname does not have the sem*(2) configured." >&4
16834 set semctl d_semctl
16836 set semget d_semget
16844 : we could also check for sys/ipc.h ...
16845 if $h_sem && $test `./findhdr sys/sem.h`; then
16846 echo "You have the full sem*(2) library." >&4
16849 echo "You don't have the full sem*(2) library." >&4
16855 : see whether sys/sem.h defines union semun
16857 $cat > try.c <<'END'
16858 #include <sys/types.h>
16859 #include <sys/ipc.h>
16860 #include <sys/sem.h>
16861 int main () { union semun semun; semun.buf = 0; }
16864 if eval $compile; then
16865 echo "You have union semun in <sys/sem.h>." >&4
16868 echo "You do not have union semun in <sys/sem.h>." >&4
16875 : see how to do semctl IPC_STAT
16879 $cat > tryh.h <<END
16882 # define S_IRUSR S_IREAD
16883 # define S_IWUSR S_IWRITE
16884 # define S_IXUSR S_IEXEC
16886 # define S_IRUSR 0400
16887 # define S_IWUSR 0200
16888 # define S_IXUSR 0100
16890 # define S_IRGRP (S_IRUSR>>3)
16891 # define S_IWGRP (S_IWUSR>>3)
16892 # define S_IXGRP (S_IXUSR>>3)
16893 # define S_IROTH (S_IRUSR>>6)
16894 # define S_IWOTH (S_IWUSR>>6)
16895 # define S_IXOTH (S_IXUSR>>6)
16898 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16899 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16900 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16903 : see whether semctl IPC_STAT can use union semun
16904 case "$d_semctl_semun" in
16908 #include <sys/types.h>
16909 #include <sys/ipc.h>
16910 #include <sys/sem.h>
16911 #include <sys/stat.h>
16918 #$d_union_semun HAS_UNION_SEMUN
16921 #ifndef HAS_UNION_SEMUN
16924 struct semid_ds *buf;
16925 unsigned short *array;
16931 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16932 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16934 struct semid_ds argbuf;
16937 st = semctl(sem, 0, IPC_STAT, arg);
16941 # endif /* IPC_STAT */
16942 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16944 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16945 # endif /* IPC_RMID */
16946 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16948 #endif /* IPC_PRIVATE && ... */
16949 printf("semget failed: errno = %d\n", errno);
16954 if eval $compile; then
16957 semun) val="$define" ;;
16965 case "$d_semctl_semun" in
16967 echo "You can use union semun for semctl IPC_STAT." >&4
16970 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16975 : see whether semctl IPC_STAT can use struct semid_ds pointer
16976 case "$d_semctl_semid_ds" in
16979 $cat > try.c <<'END'
16980 #include <sys/types.h>
16981 #include <sys/ipc.h>
16982 #include <sys/sem.h>
16983 #include <sys/stat.h>
16991 struct semid_ds arg;
16994 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16995 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16998 st = semctl(sem, 0, IPC_STAT, &arg);
17000 printf("semid_ds\n");
17002 # endif /* IPC_STAT */
17003 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17005 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17006 # endif /* IPC_RMID */
17007 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17009 #endif /* IPC_PRIVATE && ... */
17010 printf("semget failed: errno = %d\n", errno);
17016 if eval $compile; then
17019 semid_ds) val="$define" ;;
17023 set d_semctl_semid_ds
17027 case "$d_semctl_semid_ds" in
17029 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17031 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17037 # We do not have the full sem*(2) library, so assume we can not
17043 set d_semctl_semid_ds
17049 : see if sendmsg exists
17050 set sendmsg d_sendmsg
17053 : see if setegid exists
17054 set setegid d_setegid
17057 : see if seteuid exists
17058 set seteuid d_seteuid
17061 : see if setgrent exists
17062 set setgrent d_setgrent
17065 : see if setgrent_r exists
17066 set setgrent_r d_setgrent_r
17068 case "$d_setgrent_r" in
17070 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17071 case "$d_setgrent_r_proto:$usethreads" in
17072 ":define") d_setgrent_r_proto=define
17073 set d_setgrent_r_proto setgrent_r $hdrs
17077 case "$d_setgrent_r_proto" in
17079 case "$setgrent_r_proto" in
17080 ''|0) try='int setgrent_r(FILE**);'
17081 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17083 case "$setgrent_r_proto" in
17084 ''|0) try='void setgrent_r(FILE**);'
17085 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17087 case "$setgrent_r_proto" in
17088 ''|0) d_setgrent_r=undef
17090 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17091 * ) case "$setgrent_r_proto" in
17092 REENTRANT_PROTO*) ;;
17093 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17095 echo "Prototype: $try" ;;
17098 *) case "$usethreads" in
17099 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17106 *) setgrent_r_proto=0
17110 : see if sethostent exists
17111 set sethostent d_sethent
17114 : see if sethostent_r exists
17115 set sethostent_r d_sethostent_r
17117 case "$d_sethostent_r" in
17119 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17120 case "$d_sethostent_r_proto:$usethreads" in
17121 ":define") d_sethostent_r_proto=define
17122 set d_sethostent_r_proto sethostent_r $hdrs
17126 case "$d_sethostent_r_proto" in
17128 case "$sethostent_r_proto" in
17129 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17130 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17132 case "$sethostent_r_proto" in
17133 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17134 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17136 case "$sethostent_r_proto" in
17137 ''|0) d_sethostent_r=undef
17138 sethostent_r_proto=0
17139 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17140 * ) case "$sethostent_r_proto" in
17141 REENTRANT_PROTO*) ;;
17142 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17144 echo "Prototype: $try" ;;
17147 *) case "$usethreads" in
17148 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17150 d_sethostent_r=undef
17151 sethostent_r_proto=0
17155 *) sethostent_r_proto=0
17159 : see if setitimer exists
17160 set setitimer d_setitimer
17163 : see if setlinebuf exists
17164 set setlinebuf d_setlinebuf
17167 : see if setlocale exists
17168 set setlocale d_setlocale
17171 : see if locale.h is available
17172 set locale.h i_locale
17175 : see if setlocale_r exists
17176 set setlocale_r d_setlocale_r
17178 case "$d_setlocale_r" in
17180 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17181 case "$d_setlocale_r_proto:$usethreads" in
17182 ":define") d_setlocale_r_proto=define
17183 set d_setlocale_r_proto setlocale_r $hdrs
17187 case "$d_setlocale_r_proto" in
17189 case "$setlocale_r_proto" in
17190 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17191 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17193 case "$setlocale_r_proto" in
17194 ''|0) d_setlocale_r=undef
17195 setlocale_r_proto=0
17196 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17197 * ) case "$setlocale_r_proto" in
17198 REENTRANT_PROTO*) ;;
17199 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17201 echo "Prototype: $try" ;;
17204 *) case "$usethreads" in
17205 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17207 d_setlocale_r=undef
17208 setlocale_r_proto=0
17212 *) setlocale_r_proto=0
17216 : see if setnetent exists
17217 set setnetent d_setnent
17220 : see if setnetent_r exists
17221 set setnetent_r d_setnetent_r
17223 case "$d_setnetent_r" in
17225 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17226 case "$d_setnetent_r_proto:$usethreads" in
17227 ":define") d_setnetent_r_proto=define
17228 set d_setnetent_r_proto setnetent_r $hdrs
17232 case "$d_setnetent_r_proto" in
17234 case "$setnetent_r_proto" in
17235 ''|0) try='int setnetent_r(int, struct netent_data*);'
17236 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17238 case "$setnetent_r_proto" in
17239 ''|0) try='void setnetent_r(int, struct netent_data*);'
17240 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17242 case "$setnetent_r_proto" in
17243 ''|0) d_setnetent_r=undef
17244 setnetent_r_proto=0
17245 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17246 * ) case "$setnetent_r_proto" in
17247 REENTRANT_PROTO*) ;;
17248 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17250 echo "Prototype: $try" ;;
17253 *) case "$usethreads" in
17254 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17256 d_setnetent_r=undef
17257 setnetent_r_proto=0
17261 *) setnetent_r_proto=0
17265 : see if setprotoent exists
17266 set setprotoent d_setpent
17269 : see if setpgid exists
17270 set setpgid d_setpgid
17273 : see if setpgrp2 exists
17274 set setpgrp2 d_setpgrp2
17277 : see if setpriority exists
17278 set setpriority d_setprior
17281 : see if setproctitle exists
17282 set setproctitle d_setproctitle
17285 : see if setprotoent_r exists
17286 set setprotoent_r d_setprotoent_r
17288 case "$d_setprotoent_r" in
17290 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17291 case "$d_setprotoent_r_proto:$usethreads" in
17292 ":define") d_setprotoent_r_proto=define
17293 set d_setprotoent_r_proto setprotoent_r $hdrs
17297 case "$d_setprotoent_r_proto" in
17299 case "$setprotoent_r_proto" in
17300 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17301 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17303 case "$setprotoent_r_proto" in
17304 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17305 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17307 case "$setprotoent_r_proto" in
17308 ''|0) d_setprotoent_r=undef
17309 setprotoent_r_proto=0
17310 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17311 * ) case "$setprotoent_r_proto" in
17312 REENTRANT_PROTO*) ;;
17313 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17315 echo "Prototype: $try" ;;
17318 *) case "$usethreads" in
17319 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17321 d_setprotoent_r=undef
17322 setprotoent_r_proto=0
17326 *) setprotoent_r_proto=0
17330 : see if setpwent exists
17331 set setpwent d_setpwent
17334 : see if setpwent_r exists
17335 set setpwent_r d_setpwent_r
17337 case "$d_setpwent_r" in
17339 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17340 case "$d_setpwent_r_proto:$usethreads" in
17341 ":define") d_setpwent_r_proto=define
17342 set d_setpwent_r_proto setpwent_r $hdrs
17346 case "$d_setpwent_r_proto" in
17348 case "$setpwent_r_proto" in
17349 ''|0) try='int setpwent_r(FILE**);'
17350 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17352 case "$setpwent_r_proto" in
17353 ''|0) try='void setpwent_r(FILE**);'
17354 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17356 case "$setpwent_r_proto" in
17357 ''|0) d_setpwent_r=undef
17359 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17360 * ) case "$setpwent_r_proto" in
17361 REENTRANT_PROTO*) ;;
17362 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17364 echo "Prototype: $try" ;;
17367 *) case "$usethreads" in
17368 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17375 *) setpwent_r_proto=0
17379 : see if setregid exists
17380 set setregid d_setregid
17382 set setresgid d_setresgid
17385 : see if setreuid exists
17386 set setreuid d_setreuid
17388 set setresuid d_setresuid
17391 : see if setrgid exists
17392 set setrgid d_setrgid
17395 : see if setruid exists
17396 set setruid d_setruid
17399 : see if setservent exists
17400 set setservent d_setsent
17403 : see if setservent_r exists
17404 set setservent_r d_setservent_r
17406 case "$d_setservent_r" in
17408 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17409 case "$d_setservent_r_proto:$usethreads" in
17410 ":define") d_setservent_r_proto=define
17411 set d_setservent_r_proto setservent_r $hdrs
17415 case "$d_setservent_r_proto" in
17417 case "$setservent_r_proto" in
17418 ''|0) try='int setservent_r(int, struct servent_data*);'
17419 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17421 case "$setservent_r_proto" in
17422 ''|0) try='void setservent_r(int, struct servent_data*);'
17423 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17425 case "$setservent_r_proto" in
17426 ''|0) d_setservent_r=undef
17427 setservent_r_proto=0
17428 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17429 * ) case "$setservent_r_proto" in
17430 REENTRANT_PROTO*) ;;
17431 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17433 echo "Prototype: $try" ;;
17436 *) case "$usethreads" in
17437 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17439 d_setservent_r=undef
17440 setservent_r_proto=0
17444 *) setservent_r_proto=0
17448 : see if setsid exists
17449 set setsid d_setsid
17452 : see if setvbuf exists
17453 set setvbuf d_setvbuf
17456 : see if sfio.h is available
17460 : see if sfio library is available
17471 : Ok, but do we want to use it.
17475 true|$define|[yY]*) dflt='y';;
17478 echo "$package can use the sfio library, but it is experimental."
17479 rp="You seem to have sfio available, do you want to try using it?"
17482 y|Y) echo "Ok, turning on sfio then."
17485 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17490 *) case "$usesfio" in
17491 true|$define|[yY]*)
17492 echo "Sorry, cannot find sfio on this machine." >&4
17493 echo "Ignoring your setting of usesfio=$usesfio." >&4
17502 $define) usesfio='true';;
17503 *) usesfio='false';;
17507 *) : Remove sfio from list of libraries to use
17510 echo "Removing unneeded -lsfio from library list" >&4
17511 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17514 echo "libs = $libs" >&4
17521 : see if shmctl exists
17522 set shmctl d_shmctl
17525 : see if shmget exists
17526 set shmget d_shmget
17529 : see if shmat exists
17532 : see what shmat returns
17535 $cat >shmat.c <<'END'
17536 #include <sys/shm.h>
17539 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17544 echo "and it returns ($shmattype)." >&4
17545 : see if a prototype for shmat is available
17546 xxx=`./findhdr sys/shm.h`
17547 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17548 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17559 set d_shmatprototype
17562 : see if shmdt exists
17566 : see how much of the 'shm*(2)' library is present.
17569 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17570 *"$undef"*) h_shm=false;;
17574 case "`ipcs 2>&1`" in
17575 "SVID shared memory"*"not configured"*)
17576 echo "Your $osname does not have the shm*(2) configured." >&4
17579 set shmctl d_shmctl
17581 set shmget d_shmget
17591 : we could also check for sys/ipc.h ...
17592 if $h_shm && $test `./findhdr sys/shm.h`; then
17593 echo "You have the full shm*(2) library." >&4
17596 echo "You don't have the full shm*(2) library." >&4
17602 : see if we have sigaction
17604 if set sigaction val -f d_sigaction; eval $csym; $val; then
17605 echo 'sigaction() found.' >&4
17608 #include <sys/types.h>
17609 #include <signal.h>
17610 #$i_stdlib I_STDLIB
17612 #include <stdlib.h>
17616 struct sigaction act, oact;
17618 oact.sa_handler = 0;
17619 /* so that act and oact are used */
17620 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17624 if eval $compile_ok; then
17627 echo "But you don't seem to have a useable struct sigaction." >&4
17631 echo 'sigaction NOT found.' >&4
17634 set d_sigaction; eval $setvar
17637 : see if this is a sunmath.h system
17638 set sunmath.h i_sunmath
17641 : see if signbit exists
17642 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17645 #$i_sunmath I_SUNMATH
17649 #ifdef I_SUNMATH /* Solaris special math library */
17650 # include <sunmath.h>
17653 int main(int argc, char **argv)
17657 if ((signbit(x) == 0) && (signbit(y) != 0))
17665 if eval $compile; then
17666 if $run ./try; then
17670 $echo "Signbit seems to be available, but doesn't work as I expected."
17671 $echo "I won't use it." >&4
17682 : see if sigprocmask exists
17683 set sigprocmask d_sigprocmask
17686 : see if sigsetjmp exists
17688 case "$d_sigsetjmp" in
17691 #include <setjmp.h>
17692 #$i_stdlib I_STDLIB
17694 #include <stdlib.h>
17700 if (sigsetjmp(env,1))
17703 siglongjmp(env, 1);
17708 if eval $compile; then
17709 if $run ./try >/dev/null 2>&1; then
17710 echo "POSIX sigsetjmp found." >&4
17714 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17720 echo "sigsetjmp not found." >&4
17724 *) val="$d_sigsetjmp"
17725 case "$d_sigsetjmp" in
17726 $define) echo "POSIX sigsetjmp found." >&4;;
17727 $undef) echo "sigsetjmp not found." >&4;;
17735 : see if snprintf exists
17736 set snprintf d_snprintf
17739 : see if vsnprintf exists
17740 set vsnprintf d_vsnprintf
17743 case "$d_snprintf-$d_vsnprintf" in
17746 Checking whether your snprintf() and vsnprintf() work okay...
17748 $cat >try.c <<'EOCP'
17749 /* v?snprintf testing logic courtesy of Russ Allbery.
17750 * According to C99:
17751 * - if the buffer is too short it still must be \0-terminated
17752 * - if the buffer is too short the potentially required length
17753 * must be returned and not -1
17754 * - if the buffer is NULL the potentially required length
17755 * must be returned and not -1 or core dump
17758 #include <stdarg.h>
17762 int test (char *format, ...)
17767 va_start (args, format);
17768 count = vsnprintf (buf, sizeof buf, format, args);
17775 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17776 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17780 if eval $compile; then
17783 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17785 Your snprintf() and snprintf() don't seem to be working okay.
17787 d_snprintf="$undef"
17788 d_vsnprintf="$undef"
17792 echo "(I can't seem to compile the test program--assuming they don't)"
17793 d_snprintf="$undef"
17794 d_vsnprintf="$undef"
17800 : see if sockatmark exists
17801 set sockatmark d_sockatmark
17804 : see if prototype for sockatmark is available
17806 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17809 : see if socks5_init exists
17810 set socks5_init d_socks5_init
17813 : see if sprintf returns the length of the string in the buffer as per ANSI
17814 $echo "Checking whether sprintf returns the length of the string..." >&4
17817 #$i_stdlib I_STDLIB
17819 #include <stdlib.h>
17821 #$i_string I_STRING
17823 # include <string.h>
17825 # include <strings.h>
17834 int check (size_t expect, int test) {
17835 size_t got = strlen(buffer);
17839 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17844 int main(int argc, char **argv) {
17847 check(sprintf(buffer, ""), ++test);
17848 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17849 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17856 if eval $compile; then
17860 sprintf returns the length of the string (as ANSI says it should)
17862 d_sprintf_returns_strlen="$define"
17865 sprintf does not return the length of the string (how old is this system?)
17867 d_sprintf_returns_strlen="$undef"
17871 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17872 d_sprintf_returns_strlen="$undef"
17876 : see if srand48_r exists
17877 set srand48_r d_srand48_r
17879 case "$d_srand48_r" in
17881 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17882 case "$d_srand48_r_proto:$usethreads" in
17883 ":define") d_srand48_r_proto=define
17884 set d_srand48_r_proto srand48_r $hdrs
17888 case "$d_srand48_r_proto" in
17890 case "$srand48_r_proto" in
17891 ''|0) try='int srand48_r(long, struct drand48_data*);'
17892 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17894 case "$srand48_r_proto" in
17895 ''|0) d_srand48_r=undef
17897 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17898 * ) case "$srand48_r_proto" in
17899 REENTRANT_PROTO*) ;;
17900 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17902 echo "Prototype: $try" ;;
17905 *) case "$usethreads" in
17906 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17913 *) srand48_r_proto=0
17917 : see if srandom_r exists
17918 set srandom_r d_srandom_r
17920 case "$d_srandom_r" in
17922 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17923 case "$d_srandom_r_proto:$usethreads" in
17924 ":define") d_srandom_r_proto=define
17925 set d_srandom_r_proto srandom_r $hdrs
17929 case "$d_srandom_r_proto" in
17931 case "$srandom_r_proto" in
17932 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17933 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17935 case "$srandom_r_proto" in
17936 ''|0) d_srandom_r=undef
17938 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17939 * ) case "$srandom_r_proto" in
17940 REENTRANT_PROTO*) ;;
17941 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17943 echo "Prototype: $try" ;;
17946 *) case "$usethreads" in
17947 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17954 *) srandom_r_proto=0
17958 : see if prototype for setresgid is available
17960 set d_sresgproto setresgid $i_unistd unistd.h
17963 : see if prototype for setresuid is available
17965 set d_sresuproto setresuid $i_unistd unistd.h
17968 : see if sys/stat.h is available
17969 set sys/stat.h i_sysstat
17972 : see if stat knows about block sizes
17974 echo "Checking to see if your struct stat has st_blocks field..." >&4
17975 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17978 : see if this is a sys/vfs.h system
17979 set sys/vfs.h i_sysvfs
17982 : see if this is a sys/statfs.h system
17983 set sys/statfs.h i_sysstatfs
17986 : Check for statfs_s
17988 echo "Checking to see if your system supports struct statfs..." >&4
17989 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
17991 case "$d_statfs_s" in
17992 "$define") echo "Yes, it does." ;;
17993 *) echo "No, it doesn't." ;;
17997 : see if struct statfs knows about f_flags
17998 case "$d_statfs_s" in
18001 echo "Checking to see if your struct statfs has f_flags field..." >&4
18002 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
18006 set d_statfs_f_flags
18010 case "$d_statfs_f_flags" in
18011 "$define") echo "Yes, it does." ;;
18012 *) echo "No, it doesn't." ;;
18015 : see what flavor, if any, of static inline is supported
18017 echo "Checking to see if your system supports static inline..."
18018 $cat > try.c <<'EOCP'
18019 #include <stdlib.h>
18020 extern int f_via_a(int x);
18021 extern int f_via_b(int x);
18022 int main(int argc, char **argv)
18031 return EXIT_SUCCESS;
18034 return EXIT_FAILURE;
18038 $cat > a.c <<'EOCP'
18039 static INLINE int f(int x) {
18050 $cat > b.c <<'EOCP'
18051 extern int f(int x);
18059 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18060 case "$perl_static_inline" in
18061 '') # Check the various possibilities, and break out on success.
18062 # For gcc, prefer __inline__, which will still permit
18063 # cflags.SH to add in -ansi.
18064 case "$gccversion" in
18065 '') xxx="inline __inline__ __inline _inline";;
18066 *) xxx="__inline__ inline __inline _inline";;
18068 for inline in $xxx; do
18069 set try -DINLINE=$inline a.c
18070 if eval $compile && $run ./try; then
18071 # Now make sure there is no external linkage of static
18073 set try -DINLINE=$inline -DUSE_B a.c b.c
18074 if eval $compile && $run ./try; then
18075 $echo "Your compiler supports static $inline, " >&4
18076 $echo "but it also creates an external definition," >&4
18077 $echo "so I won't use it." >&4
18080 $echo "Your compiler supports static $inline." >&4
18082 perl_static_inline="static $inline";
18086 $echo "Your compiler does NOT support static $inline." >&4
18091 *inline*) # Some variant of inline exists.
18092 echo "Keeping your $hint value of $perl_static_inline."
18095 static) # No inline capabilities
18096 echo "Keeping your $hint value of $perl_static_inline."
18099 *) # Unrecognized previous value -- blindly trust the supplied
18100 # value and hope it makes sense. Use old value for
18101 # d_static_inline, if there is one.
18102 echo "Keeping your $hint value of $perl_static_inline."
18103 case "$d_static_inline" in
18105 *) val=$d_static_inline ;;
18109 # Fallback to plain 'static' if nothing worked.
18110 case "$perl_static_inline" in
18112 perl_static_inline="static"
18116 set d_static_inline
18118 $rm -f a.[co] b.[co]
18121 : Check stream access
18123 Checking how to access stdio streams by file descriptor number...
18125 case "$stdio_stream_array" in
18126 '') $cat >try.c <<EOCP
18129 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18133 for s in _iob __iob __sF
18135 set try -DSTDIO_STREAM_ARRAY=$s
18136 if eval $compile; then
18137 case "`$run ./try`" in
18138 yes) stdio_stream_array=$s; break ;;
18144 case "$stdio_stream_array" in
18146 I can't figure out how to access stdio streams by file descriptor number.
18148 d_stdio_stream_array="$undef"
18151 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18153 d_stdio_stream_array="$define"
18157 : see if strcoll exists
18158 set strcoll d_strcoll
18161 : check for structure copying
18163 echo "Checking to see if your C compiler can copy structs..." >&4
18164 $cat >try.c <<'EOCP'
18174 if $cc -c try.c >/dev/null 2>&1 ; then
18176 echo "Yup, it can."
18179 echo "Nope, it can't."
18185 : see if strerror and/or sys_errlist[] exist
18187 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18188 if set strerror val -f d_strerror; eval $csym; $val; then
18189 echo 'strerror() found.' >&4
18190 d_strerror="$define"
18191 d_strerrm='strerror(e)'
18192 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18193 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18194 d_syserrlst="$define"
18196 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18197 d_syserrlst="$undef"
18199 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18200 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18201 echo 'strerror() found in string header.' >&4
18202 d_strerror="$define"
18203 d_strerrm='strerror(e)'
18204 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18205 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18206 d_syserrlst="$define"
18208 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18209 d_syserrlst="$undef"
18211 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18212 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18213 d_strerror="$undef"
18214 d_syserrlst="$define"
18215 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18217 echo 'strerror() and sys_errlist[] NOT found.' >&4
18218 d_strerror="$undef"
18219 d_syserrlst="$undef"
18220 d_strerrm='"unknown"'
18224 : see if strerror_r exists
18225 set strerror_r d_strerror_r
18227 case "$d_strerror_r" in
18229 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18230 case "$d_strerror_r_proto:$usethreads" in
18231 ":define") d_strerror_r_proto=define
18232 set d_strerror_r_proto strerror_r $hdrs
18236 case "$d_strerror_r_proto" in
18238 case "$strerror_r_proto" in
18239 ''|0) try='int strerror_r(int, char*, size_t);'
18240 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18242 case "$strerror_r_proto" in
18243 ''|0) try='int strerror_r(int, char*, int);'
18244 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18246 case "$strerror_r_proto" in
18247 ''|0) try='char* strerror_r(int, char*, size_t);'
18248 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18250 case "$strerror_r_proto" in
18251 ''|0) d_strerror_r=undef
18253 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18254 * ) case "$strerror_r_proto" in
18255 REENTRANT_PROTO*) ;;
18256 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18258 echo "Prototype: $try" ;;
18261 *) case "$usethreads" in
18262 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18269 *) strerror_r_proto=0
18273 : see if strftime exists
18274 set strftime d_strftime
18277 : see if strlcat exists
18278 set strlcat d_strlcat
18281 : see if strlcpy exists
18282 set strlcpy d_strlcpy
18285 : see if strtod exists
18286 set strtod d_strtod
18289 : see if strtol exists
18290 set strtol d_strtol
18293 : see if strtold exists
18294 set strtold d_strtold
18297 : see if strtoll exists
18298 set strtoll d_strtoll
18301 case "$d_longlong-$d_strtoll" in
18304 Checking whether your strtoll() works okay...
18306 $cat >try.c <<'EOCP'
18309 #define strtoll __strtoll
18312 #define strtoll _strtoll
18315 extern long long int strtoll(char *s, char **, int);
18316 static int bad = 0;
18317 int check(char *s, long long ell, int een) {
18320 gll = strtoll(s, 0, 10);
18321 if (!((gll == ell) && (errno == een)))
18325 check(" 1", 1LL, 0);
18326 check(" 0", 0LL, 0);
18327 check("-1", -1LL, 0);
18328 check("-9223372036854775808", -9223372036854775808LL, 0);
18329 check("-9223372036854775808", -9223372036854775808LL, 0);
18330 check(" 9223372036854775807", 9223372036854775807LL, 0);
18331 check("-9223372036854775808", -9223372036854775808LL, 0);
18332 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18333 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18339 if eval $compile; then
18342 ok) echo "Your strtoll() seems to be working okay." ;;
18344 Your strtoll() doesn't seem to be working okay.
18350 echo "(I can't seem to compile the test program--assuming it doesn't)"
18356 : see if strtoq exists
18357 set strtoq d_strtoq
18360 : see if strtoul exists
18361 set strtoul d_strtoul
18364 case "$d_strtoul" in
18367 Checking whether your strtoul() works okay...
18369 $cat >try.c <<'EOCP'
18372 extern unsigned long int strtoul(char *s, char **, int);
18373 static int bad = 0;
18374 void check(char *s, unsigned long eul, int een) {
18377 gul = strtoul(s, 0, 10);
18378 if (!((gul == eul) && (errno == een)))
18382 check(" 1", 1L, 0);
18383 check(" 0", 0L, 0);
18385 case "$longsize" in
18387 $cat >>try.c <<'EOCP'
18388 check("18446744073709551615", 18446744073709551615UL, 0);
18389 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18390 #if 0 /* strtoul() for /^-/ strings is undefined. */
18391 check("-1", 18446744073709551615UL, 0);
18392 check("-18446744073709551614", 2, 0);
18393 check("-18446744073709551615", 1, 0);
18394 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18395 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18400 $cat >>try.c <<'EOCP'
18401 check("4294967295", 4294967295UL, 0);
18402 check("4294967296", 4294967295UL, ERANGE);
18403 #if 0 /* strtoul() for /^-/ strings is undefined. */
18404 check("-1", 4294967295UL, 0);
18405 check("-4294967294", 2, 0);
18406 check("-4294967295", 1, 0);
18407 check("-4294967296", 4294967295UL, ERANGE);
18408 check("-4294967297", 4294967295UL, ERANGE);
18413 : Should we write these tests to be more portable by sprintf-ing
18414 : ~0 and then manipulating that char string as input for strtol?
18417 $cat >>try.c <<'EOCP'
18424 if eval $compile; then
18425 case "`$run ./try`" in
18426 ok) echo "Your strtoul() seems to be working okay." ;;
18428 Your strtoul() doesn't seem to be working okay.
18434 echo "(I can't seem to compile the test program--assuming it doesn't)"
18440 : see if strtoull exists
18441 set strtoull d_strtoull
18444 case "$d_longlong-$d_strtoull" in
18447 Checking whether your strtoull() works okay...
18449 $cat >try.c <<'EOCP'
18452 #define strtoull __strtoull
18455 extern unsigned long long int strtoull(char *s, char **, int);
18456 static int bad = 0;
18457 int check(char *s, long long eull, int een) {
18460 gull = strtoull(s, 0, 10);
18461 if (!((gull == eull) && (errno == een)))
18465 check(" 1", 1LL, 0);
18466 check(" 0", 0LL, 0);
18467 check("18446744073709551615", 18446744073709551615ULL, 0);
18468 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18469 #if 0 /* strtoull() for /^-/ strings is undefined. */
18470 check("-1", 18446744073709551615ULL, 0);
18471 check("-18446744073709551614", 2LL, 0);
18472 check("-18446744073709551615", 1LL, 0);
18473 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18474 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18481 if eval $compile; then
18482 case "`$run ./try`" in
18483 ok) echo "Your strtoull() seems to be working okay." ;;
18485 Your strtoull() doesn't seem to be working okay.
18487 d_strtoull="$undef"
18491 echo "(I can't seem to compile the test program--assuming it doesn't)"
18492 d_strtoull="$undef"
18497 : see if strtouq exists
18498 set strtouq d_strtouq
18501 case "$d_strtouq" in
18504 Checking whether your strtouq() works okay...
18506 $cat >try.c <<'EOCP'
18509 extern unsigned long long int strtouq(char *s, char **, int);
18510 static int bad = 0;
18511 void check(char *s, unsigned long long eull, int een) {
18512 unsigned long long gull;
18514 gull = strtouq(s, 0, 10);
18515 if (!((gull == eull) && (errno == een)))
18519 check(" 1", 1LL, 0);
18520 check(" 0", 0LL, 0);
18521 check("18446744073709551615", 18446744073709551615ULL, 0);
18522 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18523 #if 0 /* strtouq() for /^-/ strings is undefined. */
18524 check("-1", 18446744073709551615ULL, 0);
18525 check("-18446744073709551614", 2LL, 0);
18526 check("-18446744073709551615", 1LL, 0);
18527 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18528 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18536 if eval $compile; then
18537 case "`$run ./try`" in
18538 ok) echo "Your strtouq() seems to be working okay." ;;
18540 Your strtouq() doesn't seem to be working okay.
18546 echo "(I can't seem to compile the test program--assuming it doesn't)"
18552 : see if strxfrm exists
18553 set strxfrm d_strxfrm
18556 : see if symlink exists
18557 set symlink d_symlink
18560 : see if syscall exists
18561 set syscall d_syscall
18564 : see if prototype for syscall is available
18566 set d_syscallproto syscall $i_unistd unistd.h
18569 : see if sysconf exists
18570 set sysconf d_sysconf
18573 : see if system exists
18574 set system d_system
18577 : see if tcgetpgrp exists
18578 set tcgetpgrp d_tcgetpgrp
18581 : see if tcsetpgrp exists
18582 set tcsetpgrp d_tcsetpgrp
18585 : see if prototype for telldir is available
18587 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18590 : see if time exists
18592 if test "X$d_time" = X -o X"$timetype" = X; then
18593 if set time val -f d_time; eval $csym; $val; then
18594 echo 'time() found.' >&4
18596 rp="What is the type returned by time() on this system?"
18597 set time_t timetype long stdio.h sys/types.h
18600 echo 'time() not found, hope that will do.' >&4
18608 : see if timegm exists
18609 set timegm d_timegm
18612 : see if this is a sys/times.h system
18613 set sys/times.h i_systimes
18616 : see if times exists
18618 if set times val -f d_times; eval $csym; $val; then
18619 echo 'times() found.' >&4
18622 case "$i_systimes" in
18623 "$define") inc='sys/times.h';;
18625 rp="What is the type returned by times() on this system?"
18626 set clock_t clocktype long stdio.h sys/types.h $inc
18629 echo 'times() NOT found, hope that will do.' >&4
18634 : see if tmpnam_r exists
18635 set tmpnam_r d_tmpnam_r
18637 case "$d_tmpnam_r" in
18639 hdrs="$i_systypes sys/types.h define stdio.h "
18640 case "$d_tmpnam_r_proto:$usethreads" in
18641 ":define") d_tmpnam_r_proto=define
18642 set d_tmpnam_r_proto tmpnam_r $hdrs
18646 case "$d_tmpnam_r_proto" in
18648 case "$tmpnam_r_proto" in
18649 ''|0) try='char* tmpnam_r(char*);'
18650 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18652 case "$tmpnam_r_proto" in
18653 ''|0) d_tmpnam_r=undef
18655 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18656 * ) case "$tmpnam_r_proto" in
18657 REENTRANT_PROTO*) ;;
18658 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18660 echo "Prototype: $try" ;;
18663 *) case "$usethreads" in
18664 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18671 *) tmpnam_r_proto=0
18675 : see if truncate exists
18676 set truncate d_truncate
18679 : see if ttyname_r exists
18680 set ttyname_r d_ttyname_r
18682 case "$d_ttyname_r" in
18684 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18685 case "$d_ttyname_r_proto:$usethreads" in
18686 ":define") d_ttyname_r_proto=define
18687 set d_ttyname_r_proto ttyname_r $hdrs
18691 case "$d_ttyname_r_proto" in
18693 case "$ttyname_r_proto" in
18694 ''|0) try='int ttyname_r(int, char*, size_t);'
18695 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18697 case "$ttyname_r_proto" in
18698 ''|0) try='int ttyname_r(int, char*, int);'
18699 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18701 case "$ttyname_r_proto" in
18702 ''|0) try='char* ttyname_r(int, char*, int);'
18703 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18705 case "$ttyname_r_proto" in
18706 ''|0) d_ttyname_r=undef
18708 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18709 * ) case "$ttyname_r_proto" in
18710 REENTRANT_PROTO*) ;;
18711 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18713 echo "Prototype: $try" ;;
18716 *) case "$usethreads" in
18717 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18724 *) ttyname_r_proto=0
18728 : see if tzname[] exists
18730 if set tzname val -a d_tzname; eval $csym; $val; then
18732 echo 'tzname[] found.' >&4
18735 echo 'tzname[] NOT found.' >&4
18740 : Check if is a multiplatform env
18742 next|darwin) multiarch="$define" ;;
18744 case "$multiarch" in
18745 ''|[nN]*) multiarch="$undef" ;;
18748 : check for ordering of bytes in a UV
18750 case "$usecrosscompile$multiarch" in
18753 You seem to be either cross-compiling or doing a multiarchitecture build,
18754 skipping the byteorder check.
18760 case "$byteorder" in
18763 In the following, larger digits indicate more significance. A big-endian
18764 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18765 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18766 machines may have weird orders like 3412. A Cray will report 87654321,
18767 an Alpha will report 12345678. If the test program works the default is
18769 I'm now running the test program...
18773 #$i_stdlib I_STDLIB
18775 #include <stdlib.h>
18777 #include <sys/types.h>
18778 typedef $uvtype UV;
18788 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18790 u.l = (UV)0x04030201;
18791 for (i = 0; i < $uvsize; i++)
18792 printf("%c", u.c[i]+'0');
18799 if eval $compile && $run ./try > /dev/null; then
18802 [1-4][1-4][1-4][1-4]|12345678|87654321)
18803 echo "(The test program ran ok.)"
18804 echo "byteorder=$dflt"
18807 ????|????????) echo "(The test program ran ok.)" ;;
18808 *) echo "(The test program didn't run right for some reason.)" ;;
18813 (I can't seem to compile the test program. Guessing big-endian...)
18816 case "$xxx_prompt" in
18818 rp="What is the order of bytes in $uvtype?"
18831 : Checking 32bit alignedness
18834 Checking to see whether you can access character data unalignedly...
18836 case "$d_u32align" in
18837 '') $cat >try.c <<EOCP
18839 #$i_stdlib I_STDLIB
18841 #include <stdlib.h>
18843 #define U32 $u32type
18844 #define BYTEORDER 0x$byteorder
18846 #include <signal.h>
18848 $signal_t bletch(int s) { exit(4); }
18851 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18852 volatile U8 buf[8];
18856 if (sizeof(U32) != 4) {
18857 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18864 signal(SIGBUS, bletch);
18876 for (i = 0; i < 4; i++) {
18877 up = (U32*)(buf + i);
18878 if (! ((*up == 1 << (8*i)) || /* big-endian */
18879 (*up == 1 << (8*(3-i))) /* little-endian */
18883 printf("read failed (%x)\n", *up);
18889 for (i = 0; i < 4; i++) {
18890 up = (U32*)(buf + i);
18892 if (*up != 0xBeef) {
18893 printf("write failed (%x)\n", *up);
18907 if eval $compile_ok; then
18908 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18909 $run ./try 2>&1 >/dev/null
18912 You can access character data pretty unalignedly.
18914 d_u32align="$undef"
18917 It seems that you must access character data in an aligned manner.
18919 d_u32align="$define"
18923 rp='Can you access character data at unaligned addresses?'
18927 [yY]*) d_u32align="$undef" ;;
18928 *) d_u32align="$define" ;;
18935 : see if ualarm exists
18936 set ualarm d_ualarm
18939 : see if umask exists
18943 : see if unordered exists
18944 set unordered d_unordered
18947 : see if unsetenv exists
18948 set unsetenv d_unsetenv
18951 : see if usleep exists
18952 set usleep d_usleep
18955 : see if prototype for usleep is available
18957 set d_usleepproto usleep $i_unistd unistd.h
18960 : see if ustat exists
18964 : see if closedir exists
18965 set closedir d_closedir
18968 case "$d_closedir" in
18971 echo "Checking whether closedir() returns a status..." >&4
18973 #$i_dirent I_DIRENT /**/
18974 #$i_sysdir I_SYS_DIR /**/
18975 #$i_sysndir I_SYS_NDIR /**/
18976 #$i_systypes I_SYS_TYPES /**/
18978 #if defined(I_SYS_TYPES)
18979 #include <sys/types.h>
18981 #if defined(I_DIRENT)
18982 #include <dirent.h>
18983 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18984 #include <sys/dir.h>
18988 #include <sys/ndir.h>
18992 #include <ndir.h> /* may be wrong in the future */
18994 #include <sys/dir.h>
18999 int main() { return closedir(opendir(".")); }
19002 if eval $compile_ok; then
19003 if $run ./try > /dev/null 2>&1 ; then
19004 echo "Yes, it does."
19007 echo "No, it doesn't."
19011 echo "(I can't seem to compile the test program--assuming it doesn't)"
19019 set d_void_closedir
19023 : see if there is a wait4
19027 : see if waitpid exists
19028 set waitpid d_waitpid
19031 : see if wcstombs exists
19032 set wcstombs d_wcstombs
19035 : see if wctomb exists
19036 set wctomb d_wctomb
19039 : see if writev exists
19040 set writev d_writev
19043 : preserve RCS keywords in files with variable substitution, grrr
19048 Revision='$Revision'
19050 : check for alignment requirements
19052 case "$usecrosscompile" in
19055 You seem to be cross-compiling. Skipping the memory alignment check.
19058 case "$alignbytes" in
19059 '') alignbytes=8 ;;
19063 case "$alignbytes" in
19064 '') echo "Checking alignment constraints..." >&4
19065 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19066 $cat >try.c <<'EOCP'
19067 typedef long double NV;
19070 $cat >try.c <<'EOCP'
19074 $cat >>try.c <<'EOCP'
19082 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19087 if eval $compile_ok; then
19091 echo "(I can't seem to compile the test program...)"
19093 case "$multiarch" in
19095 : The usual safe value is 8, but Darwin with -Duselongdouble
19096 : needs 16. Hence, we will take 8 as a minimum, but allow
19097 : Configure to pick a larger value if needed.
19098 if $test "$dflt" -lt 8; then
19100 echo "Setting alignment to 8 for multiarch support.">&4
19105 *) dflt="$alignbytes"
19108 rp="Doubles must be aligned on a how-many-byte boundary?"
19116 : set the base revision
19119 : length of character in bytes. Is always 1, otherwise it isnt C
19120 : This used to be a test using sizeof
19123 : Check for the number of bits in a character
19124 case "$charbits" in
19125 '') echo "Checking how long a character is (in bits)..." >&4
19132 for (c = 1, n = 0; c; c <<= 1, n++) ;
19133 printf ("%d\n", n);
19138 if eval $compile_ok; then
19142 echo "(I can't seem to compile the test program. Guessing...)"
19149 rp="What is the length of a character (in bits)?"
19153 case "$charbits" in
19156 Your system has an unsigned character size of $charbits bits, which
19157 is rather unusual (normally it is 8 bits). Perl likely will not work
19158 correctly on your system, with subtle bugs in various places.
19160 rp='Do you really want to continue?'
19164 [yY]) echo >&4 "Okay, continuing." ;;
19169 : how do we concatenate cpp tokens here?
19171 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19172 $cat >cpp_stuff.c <<'EOCP'
19173 #define RCAT(a,b)a/**/b
19174 #define ACAT(a,b)a ## b
19178 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19179 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19180 echo "Oh! Smells like ANSI's been here." >&4
19181 echo "We can catify or stringify, separately or together!"
19183 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19184 echo "Ah, yes! The good old days!" >&4
19185 echo "However, in the good old days we don't know how to stringify and"
19186 echo "catify at the same time."
19190 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19191 You're going to have to edit the values of CAT[2-5] in config.h...
19193 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19197 : see if this is a db.h system
19203 : Check db version.
19205 echo "Checking Berkeley DB version ..." >&4
19211 #include <sys/types.h>
19213 #$i_stdlib I_STDLIB
19215 #include <stdlib.h>
19218 int main(int argc, char *argv[])
19220 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19221 int Major, Minor, Patch ;
19222 unsigned long Version ;
19223 (void)db_version(&Major, &Minor, &Patch) ;
19225 printf("%d %d %d %d %d %d\n",
19226 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19227 Major, Minor, Patch);
19230 printf("You have Berkeley DB Version 2 or greater.\n");
19232 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19233 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19234 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19235 Major, Minor, Patch) ;
19237 /* check that db.h & libdb are compatible */
19238 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19239 printf("db.h and libdb are incompatible.\n") ;
19243 printf("db.h and libdb are compatible.\n") ;
19245 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19246 + DB_VERSION_PATCH ;
19248 /* needs to be >= 2.3.4 */
19249 if (Version < 2003004) {
19250 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19251 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19257 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19262 printf("You have Berkeley DB Version 1.\n");
19263 exit(0); /* DB version < 2: the coast is clear. */
19265 exit(1); /* <db.h> not Berkeley DB? */
19271 if eval $compile_ok && $run ./try; then
19272 echo 'Looks OK.' >&4
19274 db_version_major=$1
19275 db_version_minor=$2
19276 db_version_patch=$3
19278 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19282 : Remove db from list of libraries to use
19283 echo "Removing unusable -ldb from library list" >&4
19284 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19287 echo "libs = $libs" >&4
19297 : Check the return type needed for hash
19299 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19305 #include <sys/types.h>
19308 #ifndef DB_VERSION_MAJOR
19309 u_int32_t hash_cb (ptr, size)
19317 info.hash = hash_cb;
19321 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19322 if $contains warning try.out >>/dev/null 2>&1 ; then
19325 db_hashtype='u_int32_t'
19328 : XXX Maybe we should just give up here.
19329 db_hashtype=u_int32_t
19331 echo "Help: I can't seem to compile the db test program." >&4
19332 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19335 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19337 *) db_hashtype=u_int32_t
19342 : Check the return type needed for prefix
19344 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19350 #include <sys/types.h>
19353 #ifndef DB_VERSION_MAJOR
19354 size_t prefix_cb (key1, key2)
19362 info.prefix = prefix_cb;
19366 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19367 if $contains warning try.out >>/dev/null 2>&1 ; then
19368 db_prefixtype='int'
19370 db_prefixtype='size_t'
19373 db_prefixtype='size_t'
19374 : XXX Maybe we should just give up here.
19376 echo "Help: I can't seem to compile the db test program." >&4
19377 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19380 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19382 *) db_prefixtype='size_t'
19386 : How can we generate normalized random numbers ?
19388 echo "Looking for a random number function..." >&4
19389 case "$randfunc" in
19391 if set drand48 val -f; eval $csym; $val; then
19393 echo "Good, found drand48()." >&4
19394 elif set random val -f; eval $csym; $val; then
19396 echo "OK, found random()." >&4
19399 echo "Yick, looks like I have to use rand()." >&4
19410 *-Dmy_rand=*|*-Dmy_srand=*)
19411 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19412 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19413 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19414 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19418 while $test "$cont"; do
19419 rp="Use which function to generate random numbers?"
19421 if $test "$ans" = "$dflt"; then
19427 if set $ans val -f; eval $csym; $val; then
19431 rp="I cannot find function $ans. Use that name anyway?"
19440 case "$randfunc" in
19442 drand01="drand48()"
19448 case "$randbits" in
19450 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19452 #$i_unistd I_UNISTD
19453 #$i_stdlib I_STDLIB
19456 # include <unistd.h>
19459 # include <stdlib.h>
19465 unsigned long max = 0L;
19467 for (i = 1000; i; i--) {
19468 tmp = (unsigned long) $randfunc();
19469 if (tmp > max) max = tmp;
19471 for (i = 0; max; i++)
19477 if eval $compile_ok; then
19481 echo "(I can't seem to compile the test program...)"
19488 rp="How many bits does your $randfunc() function produce?"
19492 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19493 seedfunc="s$randfunc"
19494 randseedtype=unsigned
19498 rp="How many bits does your $randfunc() function produce?"
19501 seedfunc="s$randfunc"
19502 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19503 if set $seedfunc val -f; eval $csym; $val; then
19504 echo "(Using $seedfunc() to seed random generator)"
19506 echo "(Warning: no $seedfunc() to seed random generator)"
19509 randseedtype=unsigned
19516 : Determine if this is an EBCDIC system
19518 echo "Determining whether or not we are on an EBCDIC system..." >&4
19519 $cat >try.c <<'EOM'
19522 if ('M'==0xd4) return 0;
19529 if eval $compile_ok; then
19530 if $run ./try; then
19531 echo "You seem to speak EBCDIC." >&4
19534 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19537 echo "I'm unable to compile the test program." >&4
19538 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19544 : Check how to flush
19547 Checking how to flush all pending stdio output...
19549 # I only know how to find the first 32 possibly open files on SunOS.
19550 # See also hints/sunos_4_1.sh and util.c --AD
19552 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19554 $cat >>try.c <<EOCP
19556 #$i_stdlib I_STDLIB
19558 #include <stdlib.h>
19560 #$i_unistd I_UNISTD
19562 # include <unistd.h>
19564 #$d_sysconf HAS_SYSCONF
19565 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19566 #ifdef HAS_STDIO_STREAM_ARRAY
19567 # define STDIO_STREAM_ARRAY $stdio_stream_array
19572 p = fopen("try.out", "w");
19576 # ifdef TRY_FPRINTF
19580 #ifdef TRY_FFLUSH_NULL
19583 #ifdef TRY_FFLUSH_ALL
19585 long open_max = -1;
19586 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19587 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19589 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19590 open_max = sysconf(_SC_OPEN_MAX);
19593 open_max = FOPEN_MAX;
19596 open_max = OPEN_MAX;
19605 # ifdef HAS_STDIO_STREAM_ARRAY
19606 if (open_max > 0) {
19608 for (i = 0; i < open_max; i++)
19609 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19610 STDIO_STREAM_ARRAY[i]._file < open_max &&
19611 STDIO_STREAM_ARRAY[i]._flag)
19612 fflush(&STDIO_STREAM_ARRAY[i]);
19620 : first we have to find out how _not_ to flush
19622 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19624 set try -DTRY_FPUTC
19625 if eval $compile; then
19626 $run ./try 2>/dev/null
19629 if $test ! -s try.out -a "X$code" = X42; then
19635 set try -DTRY_FPRINTF
19636 if eval $compile; then
19637 $run ./try 2>/dev/null
19640 if $test ! -s try.out -a "X$code" = X42; then
19641 output=-DTRY_FPRINTF
19647 : check for fflush NULL behaviour
19648 case "$fflushNULL" in
19649 '') set try -DTRY_FFLUSH_NULL $output
19650 if eval $compile; then
19651 $run ./try 2>/dev/null
19654 if $test -s try.out -a "X$code" = X42; then
19655 fflushNULL="`$cat try.out`"
19657 if $test "X$code" != X42; then
19659 (If this test failed, don't worry, we'll try another method shortly.)
19664 $rm -f core try.core core.try.*
19665 case "$fflushNULL" in
19667 Your fflush(NULL) works okay for output streams.
19668 Let's see if it clobbers input pipes...
19670 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19671 # bug that improperly flushes the input end of pipes. So we avoid the
19672 # autoflush on fork/system/exec support for now. :-(
19673 $cat >tryp.c <<EOCP
19676 main(int argc, char **argv)
19682 while ((i = getc(stdin)) != -1
19683 && (*bp++ = i) != '\n'
19684 && bp < &buf[1024])
19687 fprintf(stdout, "%s", buf);
19695 fflushNULL="$define"
19697 if eval $compile; then
19699 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19700 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19702 fflush(NULL) seems to behave okay with input streams.
19704 fflushNULL="$define"
19707 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19709 fflushNULL="$undef"
19712 $rm -f core tryp.c tryp.core core.tryp.*
19715 Your fflush(NULL) isn't working (contrary to ANSI C).
19717 fflushNULL="$undef"
19720 Cannot figure out whether your fflush(NULL) works or not.
19721 I'm assuming it doesn't (contrary to ANSI C).
19723 fflushNULL="$undef"
19727 $define|true|[yY]*)
19728 fflushNULL="$define"
19731 fflushNULL="$undef"
19734 : check explicit looping only if NULL did not work, and if the pipe
19735 : bug does not show up on an explicit flush too
19736 case "$fflushNULL" in
19738 $cat >tryp.c <<EOCP
19741 main(int argc, char **argv)
19747 while ((i = getc(stdin)) != -1
19748 && (*bp++ = i) != '\n'
19749 && bp < &buf[1024])
19752 fprintf(stdout, "%s", buf);
19761 if eval $compile; then
19763 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19764 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19766 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19768 : now check for fflushall behaviour
19769 case "$fflushall" in
19770 '') set try -DTRY_FFLUSH_ALL $output
19771 if eval $compile; then
19773 (Now testing the other method--but note that this also may fail.)
19775 $run ./try 2>/dev/null
19778 if $test -s try.out -a "X$code" = X42; then
19779 fflushall="`$cat try.out`"
19783 case "$fflushall" in
19785 Whew. Flushing explicitly all the stdio streams works.
19787 fflushall="$define"
19790 Sigh. Flushing explicitly all the stdio streams doesn't work.
19795 Cannot figure out whether flushing stdio streams explicitly works or not.
19796 I'm assuming it doesn't.
19802 "$define"|true|[yY]*)
19803 fflushall="$define"
19811 All is futile. Even fflush(stdin) clobbers input pipes!
19818 $rm -f core tryp.c tryp.core core.tryp.*
19820 *) fflushall="$undef"
19824 case "$fflushNULL$fflushall" in
19827 OK, I give up. I cannot figure out how to flush pending stdio output.
19828 We won't be flushing handles at all before fork/exec/popen.
19834 : Store the full pathname to the ar program for use in the C program
19835 : Respect a hint or command line value for full_ar.
19840 : Store the full pathname to the sed program for use in the C program
19843 : see what type gids are declared as in the kernel
19845 echo "Looking for the type for group ids returned by getgid()."
19846 set gid_t gidtype xxx stdio.h sys/types.h
19850 xxx=`./findhdr sys/user.h`
19851 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19853 unsigned) dflt="$1 $2" ;;
19857 *) dflt="$gidtype";;
19860 gid_t) echo "gid_t found." ;;
19861 *) rp="What is the type for group ids returned by getgid()?"
19867 : Check the size of GID
19870 *_t) zzz="$gidtype" ;;
19873 echo "Checking the size of $zzz..." >&4
19875 #include <sys/types.h>
19877 #$i_stdlib I_STDLIB
19879 #include <stdlib.h>
19882 printf("%d\n", (int)sizeof($gidtype));
19887 if eval $compile_ok; then
19891 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19894 echo "Your $zzz is $gidsize bytes long."
19899 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19903 : Check if GID is signed
19906 *_t) zzz="$gidtype" ;;
19909 echo "Checking the sign of $zzz..." >&4
19911 #include <sys/types.h>
19922 if eval $compile; then
19926 echo "(I can't execute the test program--guessing unsigned.)" >&4
19930 1) echo "Your $zzz is unsigned." ;;
19931 -1) echo "Your $zzz is signed." ;;
19937 echo "(I can't compile the test program--guessing unsigned.)" >&4
19941 : Check 64bit sizes
19944 if $test X"$quadtype" != X; then
19946 echo "Checking how to print 64-bit integers..." >&4
19948 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19949 $cat >try.c <<'EOCP'
19950 #include <sys/types.h>
19953 int q = 12345678901;
19954 printf("%ld\n", q);
19958 if eval $compile; then
19962 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19963 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19964 echo "We will use %d."
19970 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19971 $cat >try.c <<'EOCP'
19972 #include <sys/types.h>
19975 long q = 12345678901;
19976 printf("%ld\n", q);
19980 if eval $compile; then
19984 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19985 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19986 echo "We will use %ld."
19992 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19993 $cat >try.c <<'EOCP'
19994 #include <sys/types.h>
19995 #include <inttypes.h>
19998 int64_t q = 12345678901;
19999 printf("%" PRId64 "\n", q);
20003 if eval $compile; then
20007 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20008 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20009 echo "We will use the C9X style."
20015 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20017 #include <sys/types.h>
20020 $quadtype q = 12345678901;
20021 printf("%Ld\n", q);
20025 if eval $compile; then
20029 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20030 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20031 echo "We will use %Ld."
20037 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20038 $cat >try.c <<'EOCP'
20039 #include <sys/types.h>
20042 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20043 printf("%lld\n", q);
20047 if eval $compile; then
20051 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20052 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20053 echo "We will use the %lld style."
20059 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20061 #include <sys/types.h>
20064 $quadtype q = 12345678901;
20065 printf("%qd\n", q);
20069 if eval $compile; then
20073 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20074 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20075 echo "We will use %qd."
20081 if $test X"$sPRId64" = X; then
20082 echo "Cannot figure out how to print 64-bit integers." >&4
20089 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20090 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20092 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20093 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20097 : Check format strings for internal types
20099 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20101 if $test X"$ivsize" = X8; then
20102 ivdformat="$sPRId64"
20103 uvuformat="$sPRIu64"
20104 uvoformat="$sPRIo64"
20105 uvxformat="$sPRIx64"
20106 uvXUformat="$sPRIXU64"
20108 if $test X"$ivsize" = X"$longsize"; then
20115 if $test X"$ivsize" = X"$intsize"; then
20123 if $test X"$ivsize" = X"$shortsize"; then
20134 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20135 nveformat="$sPRIeldbl"
20136 nvfformat="$sPRIfldbl"
20137 nvgformat="$sPRIgldbl"
20138 nvEUformat="$sPRIEUldbl"
20139 nvFUformat="$sPRIFUldbl"
20140 nvGUformat="$sPRIGUldbl"
20150 case "$ivdformat" in
20151 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20156 : Check format string for GID
20159 $echo "Checking the format string to be used for gids..." >&4
20162 -1) if $test X"$gidsize" = X"$ivsize"; then
20163 gidformat="$ivdformat"
20165 if $test X"$gidsize" = X"$longsize"; then
20168 if $test X"$gidsize" = X"$intsize"; then
20171 if $test X"$gidsize" = X"$shortsize"; then
20178 *) if $test X"$gidsize" = X"$uvsize"; then
20179 gidformat="$uvuformat"
20181 if $test X"$gidsize" = X"$longsize"; then
20184 if $test X"$gidsize" = X"$intsize"; then
20187 if $test X"$gidsize" = X"$shortsize"; then
20196 : see if getgroups exists
20197 set getgroups d_getgrps
20200 : see if setgroups exists
20201 set setgroups d_setgrps
20204 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20206 case "$d_getgrps$d_setgrps" in
20208 case "$groupstype" in
20209 '') dflt="$gidtype" ;;
20210 *) dflt="$groupstype" ;;
20213 What type of pointer is the second argument to getgroups() and setgroups()?
20214 Usually this is the same as group ids, $gidtype, but not always.
20217 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20221 *) groupstype="$gidtype";;
20224 : MAD = Misc Attribute Definition
20226 if $test $patchlevel -lt 9; then
20227 : MAD is not available in 5.8.x or earlier.
20231 $define|true|[yY]*) dflt='y' ;;
20236 Would you like to build with Misc Attribute Decoration? This is development
20237 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20238 overhead on the interpreter.
20240 If this doesn't make any sense to you, just accept the default '$dflt'.
20242 rp='Build Perl with MAD?'
20247 madlyh='madly.h madly.act madly.tab'
20249 madlyobj="madly$_o" ;;
20258 : check whether make sets MAKE
20260 echo "Checking if your $make program sets \$(MAKE)..." >&4
20261 case "$make_set_make" in
20263 $sed 's/^X //' > testmake.mak << 'EOF'
20265 X @echo 'maketemp="$(MAKE)"'
20267 case "`$make -f testmake.mak 2>/dev/null`" in
20268 *maketemp=*) make_set_make='#' ;;
20269 *) make_set_make="MAKE=$make" ;;
20271 $rm -f testmake.mak
20274 case "$make_set_make" in
20275 '#') echo "Yup, it does.";;
20276 *) echo "Nope, it doesn't.";;
20279 : see what type is used for mode_t
20280 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20281 set mode_t modetype int stdio.h sys/types.h
20284 : see if we need va_copy
20286 case "$i_stdarg" in
20289 #include <stdarg.h>
20291 #$i_stdlib I_STDLIB
20293 #include <stdlib.h>
20295 #include <signal.h>
20298 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20300 return vfprintf(f, fmt, *valp);
20304 myvfprintf(FILE *f, const char *fmt, va_list val)
20306 return ivfprintf(f, fmt, &val);
20310 myprintf(char *fmt, ...)
20313 va_start(val, fmt);
20314 return myvfprintf(stdout, fmt, val);
20318 main(int ac, char **av)
20320 signal(SIGSEGV, exit);
20322 myprintf("%s%cs all right, then\n", "that", '\'');
20327 if eval $compile && $run ./try 2>&1 >/dev/null; then
20328 case "`$run ./try`" in
20329 "that's all right, then")
20335 yes) echo "It seems that you don't need va_copy()." >&4
20336 need_va_copy="$undef"
20338 *) echo "It seems that va_copy() or similar will be needed." >&4
20339 need_va_copy="$define"
20344 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20348 : see what type is used for size_t
20349 rp="What is the type used for the length parameter for string functions?"
20350 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20353 : check for type of arguments to gethostbyaddr.
20354 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20355 case "$d_gethbyaddr" in
20359 Checking to see what type of arguments are accepted by gethostbyaddr().
20361 hdrs="$define sys/types.h
20362 $d_socket sys/socket.h
20363 $i_niin netinet/in.h
20365 $i_unistd unistd.h"
20366 : The first arg can 'char *' or 'void *'
20367 : The second arg is some of integral type
20368 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20369 for yyy in size_t long int; do
20370 case "$netdb_host_type" in
20371 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20372 if ./protochk "$try" $hdrs; then
20373 echo "Your system accepts $xxx for the first arg."
20374 echo "...and $yyy for the second arg."
20375 netdb_host_type="$xxx"
20376 netdb_hlen_type="$yyy"
20382 : In case none of those worked, prompt the user.
20383 case "$netdb_host_type" in
20384 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20387 netdb_host_type=$ans
20388 rp='What is the type for the 2nd argument to gethostbyaddr?'
20391 netdb_hlen_type=$ans
20395 *) : no gethostbyaddr, so pick harmless defaults
20396 netdb_host_type='char *'
20397 netdb_hlen_type="$sizetype"
20400 # Remove the "const" if needed. -- but then we'll have a
20402 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20405 : check for type of argument to gethostbyname.
20406 if test "X$netdb_name_type" = X ; then
20407 case "$d_gethbyname" in
20411 Checking to see what type of argument is accepted by gethostbyname().
20413 hdrs="$define sys/types.h
20414 $d_socket sys/socket.h
20415 $i_niin netinet/in.h
20417 $i_unistd unistd.h"
20418 for xxx in "const char *" "char *"; do
20419 case "$netdb_name_type" in
20420 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20421 if ./protochk "$try" $hdrs; then
20422 echo "Your system accepts $xxx."
20423 netdb_name_type="$xxx"
20428 : In case none of those worked, prompt the user.
20429 case "$netdb_name_type" in
20430 '') rp='What is the type for the 1st argument to gethostbyname?'
20433 netdb_name_type=$ans
20437 *) : no gethostbyname, so pick harmless default
20438 netdb_name_type='char *'
20443 : check for type of 1st argument to getnetbyaddr.
20444 if test "X$netdb_net_type" = X ; then
20445 case "$d_getnbyaddr" in
20449 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20451 hdrs="$define sys/types.h
20452 $d_socket sys/socket.h
20453 $i_niin netinet/in.h
20455 $i_unistd unistd.h"
20456 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20457 case "$netdb_net_type" in
20458 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20459 if ./protochk "$try" $hdrs; then
20460 echo "Your system accepts $xxx."
20461 netdb_net_type="$xxx"
20466 : In case none of those worked, prompt the user.
20467 case "$netdb_net_type" in
20468 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20471 netdb_net_type=$ans
20475 *) : no getnetbyaddr, so pick harmless default
20476 netdb_net_type='long'
20480 : locate the preferred pager for this system
20487 [a-zA-Z]:/*) dflt=$pg;;
20491 [a-zA-Z]:/*) dflt=$more;;
20495 [a-zA-Z]:/*) dflt=$less;;
20498 '') dflt=/usr/ucb/more;;
20506 rp='What pager is used on your system?'
20510 : see what type pids are declared as in the kernel
20511 rp="What is the type of process ids on this system?"
20512 set pid_t pidtype int stdio.h sys/types.h
20515 : see if ar generates random libraries by itself
20517 echo "Checking how to generate random libraries on your machine..." >&4
20518 echo 'int bar1() { return bar2(); }' > bar1.c
20519 echo 'int bar2() { return 2; }' > bar2.c
20521 #$i_stdlib I_STDLIB
20523 #include <stdlib.h>
20525 int main() { printf("%d\n", bar1()); exit(0); }
20527 $cc $ccflags -c bar1.c >/dev/null 2>&1
20528 $cc $ccflags -c bar2.c >/dev/null 2>&1
20529 $cc $ccflags -c foo.c >/dev/null 2>&1
20530 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20531 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20532 $run ./foobar >/dev/null 2>&1; then
20533 echo "$ar appears to generate random libraries itself."
20535 if [ "X$ranlib" = "X" ]; then
20538 elif $ar s bar$_a >/dev/null 2>&1 &&
20539 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20540 $run ./foobar >/dev/null 2>&1; then
20541 echo "a table of contents needs to be added with '$ar s'."
20544 elif $ar ts bar$_a >/dev/null 2>&1 &&
20545 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20546 $run ./foobar >/dev/null 2>&1; then
20547 echo "a table of contents needs to be added with '$ar ts'."
20554 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20555 $test -f $ranlib || ranlib=''
20558 if $test -n "$ranlib"; then
20559 echo "your system has '$ranlib'; we'll use that."
20562 echo "your system doesn't seem to support random libraries"
20563 echo "so we'll use lorder and tsort to order the libraries."
20570 : see if this is a values.h system
20571 set values.h i_values
20574 : Check the max offset that gmtime and localtime accept
20575 echo "Checking max offsets that gmtime () accepts"
20578 define) yyy="#include <values.h>" ;;
20582 case "$sGMTIME_min/$sGMTIME_max" in
20585 #include <sys/types.h>
20594 void gm_check (time_t t, int min_year, int max_year)
20597 if ( tmp == NULL ||
20598 /* Check tm_year overflow */
20599 tmp->tm_year < min_year || tmp->tm_year > max_year)
20610 gm_check (MAXLONG, 69, 0x7fffffff);
20612 if (tmp == NULL || tmp->tm_year < 0) {
20613 for (i = 63; i >= 0; i--) {
20614 time_t x = pt | ((time_t)1 << i);
20615 if (x < 0 || x < pt) continue;
20616 gm_check (x, 69, 0x7fffffff);
20619 printf ("sGMTIME_max=%ld\n", pt);
20628 gm_check (MINLONG, -1900, 70);
20631 for (i = 36; i >= 0; i--) {
20632 time_t x = pt - ((time_t)1 << i);
20633 if (x > 0) continue;
20634 gm_check (x, -1900, 70);
20637 printf ("sGMTIME_min=%ld\n", pt);
20641 int main (int argc, char *argv[])
20643 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20650 if eval $compile; then
20653 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20659 echo "Checking max offsets that localtime () accepts"
20661 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20664 #include <sys/types.h>
20673 void local_check (time_t t, int min_year, int max_year)
20675 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20678 tmp = localtime (&t);
20679 if ( tmp == NULL ||
20680 /* Check tm_year overflow */
20681 tmp->tm_year < min_year || tmp->tm_year > max_year)
20685 } /* local_check */
20692 local_check (MAXLONG, 69, 0x7fffffff);
20694 if (tmp == NULL || tmp->tm_year < 0) {
20695 for (i = 63; i >= 0; i--) {
20696 time_t x = pt | ((time_t)1 << i);
20697 if (x < 0 || x < pt) continue;
20698 local_check (x, 69, 0x7fffffff);
20701 printf ("sLOCALTIME_max=%ld\n", pt);
20710 local_check (MINLONG, -1900, 70);
20713 for (i = 36; i >= 0; i--) {
20714 time_t x = pt - ((time_t)1 << i);
20715 if (x > 0) continue;
20716 local_check (x, -1900, 70);
20719 printf ("sLOCALTIME_min=%ld\n", pt);
20723 int main (int argc, char *argv[])
20731 if eval $compile; then
20734 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20740 : check for type of arguments to select.
20741 case "$selecttype" in
20742 '') case "$d_select" in
20746 Checking to see what type of arguments are accepted by select().
20748 hdrs="$define sys/types.h
20749 $i_systime sys/time.h
20750 $i_sysselct sys/select.h
20751 $d_socket sys/socket.h"
20752 : The first arg can be int, unsigned, or size_t
20753 : The last arg may or may not be 'const'
20755 : void pointer has been seen but using that
20756 : breaks the selectminbits test
20757 for xxx in 'fd_set *' 'int *'; do
20758 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20759 for tmo in 'struct timeval *' 'const struct timeval *'; do
20761 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20762 if ./protochk "$try" $hdrs; then
20763 echo "Your system accepts $xxx."
20772 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20773 case "$d_fd_set" in
20774 $define) dflt="fd_set *" ;;
20783 *) : no select, so pick a harmless default
20790 : check for the select 'width'
20791 case "$selectminbits" in
20792 '') safebits=`expr $ptrsize \* 8`
20793 case "$d_select" in
20797 Checking to see on how many bits at a time your select() operates...
20800 #include <sys/types.h>
20802 #$i_systime I_SYS_TIME
20803 #$i_systimek I_SYS_TIME_KERNEL
20808 # ifdef I_SYS_TIME_KERNEL
20811 # include <sys/time.h>
20812 # ifdef I_SYS_TIME_KERNEL
20816 #$i_sysselct I_SYS_SELECT
20817 #ifdef I_SYS_SELECT
20818 #include <sys/select.h>
20820 #$d_socket HAS_SOCKET
20822 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20825 #$i_stdlib I_STDLIB
20827 #include <stdlib.h>
20830 #define S sizeof(*(b))
20832 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20833 #define NBITS (NBYTES * 8)
20835 char *s = (char *)malloc(NBYTES);
20844 fp = fopen("try.c", "r");
20850 b = ($selecttype)s;
20851 for (i = 0; i < NBITS; i++)
20855 select(fd + 1, b, 0, 0, &t);
20856 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20858 printf("%d\n", i + 1);
20863 if eval $compile_ok; then
20864 selectminbits=`$run ./try`
20865 case "$selectminbits" in
20867 Cannot figure out on how many bits at a time your select() operates.
20868 I'll play safe and guess it is $safebits bits.
20870 selectminbits=$safebits
20871 bits="$safebits bits"
20874 *) bits="$selectminbits bits" ;;
20876 echo "Your select() operates on $bits at a time." >&4
20878 rp='What is the minimum number of bits your select() operates on?'
20879 case "$byteorder" in
20880 12345678) dflt=64 ;;
20886 selectminbits="$val"
20890 *) : no select, so pick a harmless default
20891 selectminbits=$safebits
20897 : Trace out the files included by signal.h, then look for SIGxxx names.
20898 if [ "X$fieldn" = X ]; then
20899 : Just make some guesses. We check them later.
20900 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20902 xxx=`echo '#include <signal.h>' |
20903 $cppstdin $cppminus $cppflags 2>/dev/null |
20904 $grep '^[ ]*#.*include' |
20905 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20906 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20909 for xx in $xxx /dev/null ; do
20910 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20912 case "$xxxfiles" in
20913 '') xxxfiles=`./findhdr signal.h` ;;
20916 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20917 print substr($2, 4, 20)
20919 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20920 print substr($3, 4, 20)
20922 : Append some common names just in case the awk scan failed.
20923 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20924 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20925 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20926 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20927 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20929 : generate a few handy files for later
20930 $cat > signal.c <<EOCP
20931 #include <sys/types.h>
20932 #include <signal.h>
20933 #$i_stdlib I_STDLIB
20935 #include <stdlib.h>
20940 /* Strange style to avoid deeply-nested #if/#else/#endif */
20943 # define NSIG (_NSIG)
20949 # define NSIG (SIGMAX+1)
20955 # define NSIG (SIG_MAX+1)
20961 # define NSIG (_SIG_MAX+1)
20967 # define NSIG (MAXSIG+1)
20973 # define NSIG (MAX_SIG+1)
20978 # ifdef SIGARRAYSIZE
20979 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20985 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20989 /* Default to some arbitrary number that's big enough to get most
20990 of the common signals.
20996 printf("NSIG %d\n", NSIG);
21002 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21004 printf "#ifdef SIG"; printf $1; printf "\n"
21005 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21006 printf $1; printf ");\n"
21010 printf "#endif /* JUST_NSIG */\n";
21011 printf "exit(0);\n}\n";
21014 $cat >signal.awk <<'EOP'
21015 BEGIN { ndups = 0 }
21016 $1 ~ /^NSIG$/ { nsig = $2 }
21017 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21018 if ($2 > maxsig) { maxsig = $2 }
21019 if (sig_name[$2]) {
21020 dup_name[ndups] = $1
21021 dup_num[ndups] = $2
21033 printf("NSIG %d\n", nsig);
21034 for (n = 1; n < nsig; n++) {
21036 printf("%s %d\n", sig_name[n], sig_num[n])
21039 printf("NUM%d %d\n", n, n)
21042 for (n = 0; n < ndups; n++) {
21043 printf("%s %d\n", dup_name[n], dup_num[n])
21047 $cat >signal_cmd <<EOS
21049 if $test -s signal.lst; then
21050 echo "Using your existing signal.lst file"
21055 $cat >>signal_cmd <<'EOS'
21058 if eval $compile_ok; then
21059 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21060 $uniq | $awk -f signal.awk >signal.lst
21062 echo "(I can't seem be able to compile the whole test program)" >&4
21063 echo "(I'll try it in little pieces.)" >&4
21064 set signal -DJUST_NSIG
21065 if eval $compile_ok; then
21066 $run ./signal$_exe > signal.nsg
21069 echo "I can't seem to figure out how many signals you have." >&4
21070 echo "Guessing 50." >&4
21071 echo 'NSIG 50' > signal.nsg
21073 : Now look at all the signal names, one at a time.
21074 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21075 $cat > signal.c <<EOCP
21076 #include <sys/types.h>
21077 #include <signal.h>
21080 printf("$xx %d\n", SIG${xx});
21085 if eval $compile; then
21086 echo "SIG${xx} found."
21087 $run ./signal$_exe >> signal.ls1
21089 echo "SIG${xx} NOT found."
21092 if $test -s signal.ls1; then
21093 $cat signal.nsg signal.ls1 |
21094 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21098 if $test -s signal.lst; then
21101 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21102 echo 'kill -l' >signal
21103 set X `csh -f <signal`
21107 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21109 echo $@ | $tr ' ' $trnl | \
21110 $awk '{ printf "%s %d\n", $1, ++s; }
21111 END { printf "NSIG %d\n", ++s }' >signal.lst
21113 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21115 chmod a+x signal_cmd
21116 $eunicefix signal_cmd
21118 : generate list of signal names
21120 case "$sig_name_init" in
21122 *) case "$sig_num_init" in
21123 ''|*,*) doinit=yes ;;
21128 echo "Generating a list of signal names and numbers..." >&4
21130 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21131 sig_name=`$awk 'BEGIN { printf "ZERO " }
21132 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21133 sig_num=`$awk 'BEGIN { printf "0 " }
21134 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21135 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21136 !/^NSIG/ { printf "\"%s\", ", $1 }
21137 END { printf "0\n" }' signal.lst`
21138 sig_num_init=`$awk 'BEGIN { printf "0, " }
21139 !/^NSIG/ { printf "%d, ", $2}
21140 END { printf "0\n"}' signal.lst`
21143 echo "The following $sig_count signals are available:"
21145 echo $sig_name | $awk \
21146 'BEGIN { linelen = 0 }
21148 for (i = 1; i <= NF; i++) {
21149 name = "SIG" $i " "
21150 linelen = linelen + length(name)
21151 if (linelen > 70) {
21153 linelen = length(name)
21159 sig_size=`echo $sig_name | awk '{print NF}'`
21160 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21162 : Check size of size
21164 case "$sizetype" in
21165 *_t) zzz="$sizetype" ;;
21166 *) zzz="filesize" ;;
21168 echo "Checking the size of $zzz..." >&4
21170 #include <sys/types.h>
21172 #$i_stdlib I_STDLIB
21174 #include <stdlib.h>
21177 printf("%d\n", (int)sizeof($sizetype));
21182 if eval $compile_ok; then
21186 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21189 echo "Your $zzz size is $sizesize bytes."
21194 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21198 : check for socklen_t
21200 echo "Checking to see if you have socklen_t..." >&4
21202 #include <sys/types.h>
21203 #$d_socket HAS_SOCKET
21205 #include <sys/socket.h>
21207 int main() { socklen_t x = 16; }
21210 if eval $compile; then
21212 echo "You have socklen_t."
21215 echo "You do not have socklen_t."
21216 case "$sizetype" in
21217 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21224 : see if this is a socks.h system
21225 set socks.h i_socks
21228 : check for type of the size argument to socket calls
21229 case "$d_socket" in
21233 Checking to see what type is the last argument of accept().
21236 case "$d_socklen_t" in
21237 "$define") yyy="$yyy socklen_t"
21239 yyy="$yyy $sizetype int long unsigned"
21240 for xxx in $yyy; do
21241 case "$socksizetype" in
21242 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21243 case "$usesocks" in
21245 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21246 echo "Your system accepts '$xxx *' for the last argument of accept()."
21247 socksizetype="$xxx"
21250 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21251 echo "Your system accepts '$xxx *' for the last argument of accept()."
21252 socksizetype="$xxx"
21259 : In case none of those worked, prompt the user.
21260 case "$socksizetype" in
21261 '') rp='What is the type for socket address structure sizes?'
21268 *) : no sockets, so pick relatively harmless default
21273 : see what type is used for signed size_t
21274 set ssize_t ssizetype int stdio.h sys/types.h
21279 #$i_stdlib I_STDLIB
21281 #include <stdlib.h>
21283 #include <sys/types.h>
21284 #define Size_t $sizetype
21285 #define SSize_t $dflt
21288 if (sizeof(Size_t) == sizeof(SSize_t))
21290 else if (sizeof(Size_t) == sizeof(int))
21299 if eval $compile_ok && $run ./try > /dev/null; then
21300 ssizetype=`$run ./try`
21301 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21304 Help! I can't compile and run the ssize_t test program: please enlighten me!
21305 (This is probably a misconfiguration in your system or libraries, and
21306 you really ought to fix it. Still, I'll try anyway.)
21308 I need a type that is the same size as $sizetype, but is guaranteed to
21309 be signed. Common values are ssize_t, int and long.
21312 rp="What signed type is the same size as $sizetype?"
21318 : Check the size of st_ino
21320 $echo "Checking the size of st_ino..." >&4
21321 $cat > try.c <<EOCP
21322 #include <sys/stat.h>
21324 #$i_stdlib I_STDLIB
21326 #include <stdlib.h>
21330 printf("%d\n", (int)sizeof(st.st_ino));
21335 if eval $compile_ok; then
21339 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21341 *) st_ino_size=$val
21342 $echo "Your st_ino is $st_ino_size bytes long."
21347 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21351 : Check if st_ino is signed
21353 $echo "Checking the sign of st_ino..." >&4
21354 $cat > try.c <<EOCP
21355 #include <sys/stat.h>
21360 if (foo.st_ino < 0)
21367 if eval $compile; then
21371 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21373 *) st_ino_sign=$val
21374 case "$st_ino_sign" in
21375 1) $echo "Your st_ino is unsigned." ;;
21376 -1) $echo "Your st_ino is signed." ;;
21382 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21386 : see what type of char stdio uses.
21388 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21389 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21390 echo "Your stdio uses unsigned chars." >&4
21391 stdchar="unsigned char"
21393 echo "Your stdio uses signed chars." >&4
21398 : see what type uids are declared as in the kernel
21400 echo "Looking for the type for user ids returned by getuid()."
21401 set uid_t uidtype xxx stdio.h sys/types.h
21405 xxx=`./findhdr sys/user.h`
21406 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21408 unsigned) dflt="$1 $2" ;;
21412 *) dflt="$uidtype";;
21415 uid_t) echo "uid_t found." ;;
21416 *) rp="What is the type for user ids returned by getuid()?"
21422 : Check size of UID
21425 *_t) zzz="$uidtype" ;;
21428 echo "Checking the size of $zzz..." >&4
21430 #include <sys/types.h>
21432 #$i_stdlib I_STDLIB
21434 #include <stdlib.h>
21437 printf("%d\n", (int)sizeof($uidtype));
21442 if eval $compile_ok; then
21446 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21449 echo "Your $zzz is $uidsize bytes long."
21454 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21457 : Check if UID is signed
21460 *_t) zzz="$uidtype" ;;
21463 echo "Checking the sign of $zzz..." >&4
21465 #include <sys/types.h>
21476 if eval $compile; then
21480 echo "(I can't execute the test program--guessing unsigned.)" >&4
21484 1) echo "Your $zzz is unsigned." ;;
21485 -1) echo "Your $zzz is signed." ;;
21491 echo "(I can't compile the test program--guessing unsigned.)" >&4
21495 : Check format string for UID
21497 $echo "Checking the format string to be used for uids..." >&4
21500 -1) if $test X"$uidsize" = X"$ivsize"; then
21501 uidformat="$ivdformat"
21503 if $test X"$uidsize" = X"$longsize"; then
21506 if $test X"$uidsize" = X"$intsize"; then
21509 if $test X"$uidsize" = X"$shortsize"; then
21516 *) if $test X"$uidsize" = X"$uvsize"; then
21517 uidformat="$uvuformat"
21519 if $test X"$uidsize" = X"$longsize"; then
21522 if $test X"$uidsize" = X"$intsize"; then
21525 if $test X"$uidsize" = X"$shortsize"; then
21534 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21536 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21537 $cat >try.c <<'EOM'
21538 /* Intentionally a long probe as I'd like to sanity check that the exact
21539 approach is going to work, as thinking it will work, but only having it
21540 part working at runtime is worse than not having it. */
21542 #include <sys/types.h>
21543 #include <sys/sysctl.h>
21544 #include <sys/param.h>
21546 #include <string.h>
21547 #include <stdlib.h>
21548 #include <unistd.h>
21551 main(int argc, char **argv) {
21553 char *argv_leaf = strrchr(argv[0], '/');
21559 mib[1] = KERN_PROC;
21560 mib[2] = KERN_PROC_PATHNAME;
21564 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21568 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21573 if (size < strlen(argv_leaf) + 1) {
21574 fprintf(stderr, "size %lu is too short for a path\n",
21575 (unsigned long) size);
21579 if (size > MAXPATHLEN * MAXPATHLEN) {
21580 fprintf(stderr, "size %lu is too long for a path\n",
21581 (unsigned long) size);
21585 buffer = malloc(size);
21591 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21596 if (strlen(buffer) + 1 != size) {
21597 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21598 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21603 if (*buffer != '/') {
21604 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21608 if (strstr(buffer, "/./")) {
21609 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21613 if (strstr(buffer, "/../")) {
21614 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21618 buffer_leaf = strrchr(buffer, '/');
21619 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21620 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21632 if eval $compile; then
21633 if $run ./try; then
21634 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21637 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21641 echo "I'm unable to compile the test program." >&4
21642 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21646 set usekernprocpathname
21649 : Determine if we can use _NSGetExecutablePath to find executing program
21651 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21652 $cat >try.c <<'EOM'
21653 /* Intentionally a long probe as I'd like to sanity check that the exact
21654 approach is going to work, as thinking it will work, but only having it
21655 part working at runtime is worse than not having it. */
21656 #include <mach-o/dyld.h>
21658 #include <stdlib.h>
21659 #include <sys/param.h>
21660 #include <string.h>
21663 main(int argc, char **argv) {
21665 uint32_t size = sizeof(buf);
21669 char *argv_leaf = strrchr(argv[0], '/');
21673 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21677 _NSGetExecutablePath(buf, &size);
21678 if (size > MAXPATHLEN * MAXPATHLEN) {
21679 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21680 (unsigned int) size);
21684 buffer = malloc(size);
21690 result = _NSGetExecutablePath(buffer, &size);
21692 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21693 result, (unsigned int) size);
21697 tidied = realpath(buffer, NULL);
21699 perror("realpath");
21705 if (*tidied != '/') {
21706 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21710 if (strstr(tidied, "/./")) {
21711 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21715 if (strstr(tidied, "/../")) {
21716 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21720 tidied_leaf = strrchr(tidied, '/');
21721 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21722 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21734 if eval $compile; then
21735 if $run ./try; then
21736 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21739 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21742 echo "I'm unable to compile the test program." >&4
21743 echo "I'll assume no _NSGetExecutablePath here." >&4
21746 set usensgetexecutablepath
21749 : Check if site customization support was requested
21750 case "$usesitecustomize" in
21751 $define|true|[Yy]*)
21752 usesitecustomize="$define"
21755 usesitecustomize="$undef"
21759 : see if prototypes support variable argument declarations
21761 case "$prototype$i_stdarg" in
21763 echo "It appears we'll be able to prototype varargs functions." >&4
21767 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21774 : determine compiler compiler
21783 if $test -f "$byacc$_exe"; then
21785 comp="byacc or $comp"
21787 if $test -f "$bison$_exe"; then
21788 comp="$comp or bison -y"
21790 rp="Which compiler compiler ($comp) shall I use?"
21799 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21805 : see if this is a assert.h system
21806 set assert.h i_assert
21809 : see if this is a fp.h system
21813 : see if this is a fp_class.h system
21814 set fp_class.h i_fp_class
21817 : see if gdbm.h is available
21822 : see if gdbm_open exists
21823 set gdbm_open d_gdbm_open
21825 case "$d_gdbm_open" in
21828 echo "We won't be including <gdbm.h>"
21837 : see if this is a ieeefp.h system
21838 case "$i_ieeefp" in
21839 '' ) set ieeefp.h i_ieeefp
21844 : see if this is a libutil.h system
21845 set libutil.h i_libutil
21848 : see if mach cthreads are available
21849 if test "X$usethreads" = "X$define"; then
21850 set mach/cthreads.h i_machcthr
21853 i_machcthr="$undef"
21856 : see if this is a mntent.h system
21857 set mntent.h i_mntent
21860 : see if net/errno.h is available
21862 set net/errno.h val
21865 : Unfortunately, it causes problems on some systems. Arrgh.
21868 cat > try.c <<'EOM'
21871 #include <net/errno.h>
21877 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21878 echo "We'll be including <net/errno.h>." >&4
21880 echo "We won't be including <net/errno.h>." >&4
21889 : see if netinet/tcp.h is available
21890 set netinet/tcp.h i_netinettcp
21893 : see if this is a poll.h system
21897 : see if this is a prot.h system
21901 : Preprocessor symbols
21903 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21904 $cat <<'EOSH' > Cppsym.know
21905 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21906 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21907 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21908 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21909 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21910 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21911 bull c cadmus clipper CMU COFF COMPILER_VERSION
21912 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21913 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21914 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21915 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21917 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21918 H3050R H3050RX hbullx20 hcx host_mips
21919 hp200 hp300 hp700 HP700 hp800 hp9000
21920 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21921 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21922 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21923 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21924 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21925 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21926 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21927 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21928 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21929 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21930 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21931 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21932 MATH_HAS_NO_SIDE_EFFECTS
21933 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21934 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21935 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21936 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21937 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21938 NetBSD news1500 news1700 news1800 news1900 news3700
21939 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21940 ns32016 ns32332 ns32k nsc32000
21941 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21942 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21943 pc532 pdp11 PGC PIC plexus PORTAR posix
21944 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21945 POSIX_C_SOURCE POSIX_SOURCE POWER
21946 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21947 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21948 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21949 sony sony_news sonyrisc sparc sparclite spectrum
21950 stardent stdc STDC_EXT stratos sun sun3 sun386
21951 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21952 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21953 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21954 sysV68 sysV88 Tek4132 Tek4300 titan
21955 TM3200 TM5400 TM5600
21956 tower tower32 tower32_200 tower32_600 tower32_700
21957 tower32_800 tower32_850 tss
21958 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21959 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21960 unix UNIX95 UNIX99 unixpc unos
21961 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21962 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21963 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21965 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21966 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21967 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21970 # Maybe put other stuff here too.
21971 cat <<EOSH >>Cppsym.know
21974 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21975 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21976 $cat Cppsym.know > Cppsym.c
21977 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21978 $rm -f Cppsym.a Cppsym.b Cppsym.c
21979 cat <<EOSH > Cppsym
21981 if $test \$# -gt 0; then
21982 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21983 if $test -s Cppsym.got; then
21990 $tr " " "$trnl" | ./Cppsym.try
21996 cat <<EOSH > Cppsym.try
21998 cat <<'EOCP' > try.c
22001 #define STRINGIFY(a) "a"
22003 #if cpp_stuff == 42
22004 #define StGiFy(a) #a
22005 #define STRINGIFY(a) StGiFy(a)
22007 #if $cpp_stuff != 1 && $cpp_stuff != 42
22008 # include "Bletch: How does this C preprocessor stringify macros?"
22014 cat <<'EOSH' >> Cppsym.try
22016 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22017 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22018 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22019 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22021 echo 'return 0;}' >> try.c
22023 cat <<EOSH >> Cppsym.try
22025 case "$osname-$gccversion" in
22026 irix-) ccflags="\$ccflags -woff 1178" ;;
22027 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22029 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22031 chmod +x Cppsym.try
22032 $eunicefix Cppsym.try
22033 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22034 : Add in any linux cpp "predefined macros":
22035 case "$osname::$gccversion" in
22036 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22038 rm -f $tHdrH'.h' $tHdrH
22040 # Filter out macro arguments, such as Linux's __INT8_C(c)
22041 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22042 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22043 if [ -s $tHdrH'_cppsym.real' ]; then
22044 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22047 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22050 : now check the C compiler for additional symbols
22051 postprocess_cc_v=''
22053 aix) postprocess_cc_v="|$tr , ' '" ;;
22060 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22063 -D*) echo "\$i" | $sed 's/^-D//';;
22064 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22069 postprocess_cc_v=''
22072 ./ccsym > ccsym1.raw
22073 if $test -s ccsym1.raw; then
22074 $sort ccsym1.raw | $uniq >ccsym.raw
22076 mv ccsym1.raw ccsym.raw
22079 $awk '/\=/ { print $0; next }
22080 { print $0"=1" }' ccsym.raw >ccsym.list
22081 $comm -13 Cppsym.true ccsym.list >ccsym.own
22082 $comm -12 Cppsym.true ccsym.list >ccsym.com
22083 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22085 if $test -z ccsym.raw; then
22086 echo "Your C compiler doesn't seem to define any symbols!" >&4
22088 echo "However, your C preprocessor defines the following symbols:"
22091 cppsymbols=`$cat Cppsym.true`
22092 cppsymbols=`echo $cppsymbols`
22093 cppccsymbols="$cppsymbols"
22095 if $test -s ccsym.com; then
22096 echo "Your C compiler and pre-processor define these symbols:"
22097 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22100 cppccsymbols=`$cat ccsym.com`
22101 cppccsymbols=`echo $cppccsymbols`
22102 $test "$silent" || sleep 1
22104 if $test -s ccsym.cpp; then
22105 $test "$also" && echo " "
22106 echo "Your C pre-processor ${also}defines the following symbols:"
22107 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22109 cppsymbols=`$cat ccsym.cpp`
22110 cppsymbols=`echo $cppsymbols`
22111 $test "$silent" || sleep 1
22113 if $test -s ccsym.own; then
22114 $test "$also" && echo " "
22115 echo "Your C compiler ${also}defines the following cpp symbols:"
22116 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22117 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22118 ccsymbols=`$cat ccsym.own`
22119 ccsymbols=`echo $ccsymbols`
22120 $test "$silent" || sleep 1
22124 : see if this is a termio system
22128 if $test `./findhdr termios.h`; then
22129 set tcsetattr i_termios
22135 "$define") echo "You have POSIX termios.h... good!" >&4;;
22136 *) if ./Cppsym pyr; then
22137 case "`/bin/universe`" in
22138 ucb) if $test `./findhdr sgtty.h`; then
22140 echo "<sgtty.h> found." >&4
22142 echo "System is pyramid with BSD universe."
22143 ./warn "<sgtty.h> not found--you could have problems."
22145 *) if $test `./findhdr termio.h`; then
22147 echo "<termio.h> found." >&4
22149 echo "System is pyramid with USG universe."
22150 ./warn "<termio.h> not found--you could have problems."
22154 if $test `./findhdr termio.h`; then
22155 echo "<termio.h> found." >&4
22157 elif $test `./findhdr sgtty.h`; then
22158 echo "<sgtty.h> found." >&4
22161 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22164 if $test `./findhdr sgtty.h`; then
22165 echo "<sgtty.h> found." >&4
22167 elif $test `./findhdr termio.h`; then
22168 echo "<termio.h> found." >&4
22171 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22175 set i_termio; eval $setvar
22176 val=$val2; set i_sgtty; eval $setvar
22177 val=$val3; set i_termios; eval $setvar
22179 : see if stdbool is available
22180 : we want a real compile instead of Inhdr because some Solaris systems
22181 : have stdbool.h, but it can only be used if the compiler indicates it
22182 : is sufficiently c99-compliant.
22186 #include <stdbool.h>
22191 int main(int argc, char **argv)
22197 if eval $compile; then
22198 echo "<stdbool.h> found." >&4
22201 echo "<stdbool.h> NOT found." >&4
22208 : see if stddef is available
22209 set stddef.h i_stddef
22212 : see if sys/access.h is available
22213 set sys/access.h i_sysaccess
22216 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22217 set sys/filio.h i_sysfilio
22220 if $test `./findhdr sys/ioctl.h`; then
22222 echo '<sys/ioctl.h> found.' >&4
22225 if $test $i_sysfilio = "$define"; then
22226 echo '<sys/ioctl.h> NOT found.' >&4
22228 $test $i_sgtty = "$define" && xxx="sgtty.h"
22229 $test $i_termio = "$define" && xxx="termio.h"
22230 $test $i_termios = "$define" && xxx="termios.h"
22231 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22237 : see if socket ioctl defs are in sys/sockio.h
22239 xxx=`./findhdr sys/sockio.h`
22240 if $test "$xxx"; then
22241 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22243 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22246 echo "No socket ioctls found in <sys/sockio.h>." >&4
22251 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22257 : see if this is a syslog.h system
22258 set syslog.h i_syslog
22261 : see if this is a sys/mode.h system
22262 set sys/mode.h i_sysmode
22265 : see if there is a sys/poll.h file
22266 set sys/poll.h i_syspoll
22269 : see if sys/resource.h has to be included
22270 set sys/resource.h i_sysresrc
22273 : see if sys/security.h is available
22274 set sys/security.h i_syssecrt
22277 : see if this is a sys/statvfs.h system
22278 set sys/statvfs.h i_sysstatvfs
22281 : see if this is a sys/un.h system
22282 set sys/un.h i_sysun
22285 : see if this is a sys/utsname.h system
22286 set sys/utsname.h i_sysutsname
22289 : see if this is a syswait system
22290 set sys/wait.h i_syswait
22293 : see if this is a ustat.h system
22294 set ustat.h i_ustat
22297 : see if this is an utime system
22298 set utime.h i_utime
22301 : see if this is a vfork system
22304 set vfork.h i_vfork
22314 echo "Looking for extensions..." >&4
22315 : If we are using the old config.sh, known_extensions may contain
22316 : old or inaccurate or duplicate values.
22317 known_extensions=''
22318 nonxs_extensions=''
22319 : We do not use find because it might not be available.
22320 : We do not just use MANIFEST because the user may have dropped
22321 : some additional extensions into the source tree and expect them
22324 : Function to recursively find available extensions, ignoring DynaLoader
22325 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22326 : In 5.10.1 and later, extensions are stored in directories
22327 : like File-Glob instead of the older File/Glob/.
22331 DynaLoader|dynaload) ;;
22333 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22334 leaf=`echo $xxx | $sed -e s/.*-//`;
22335 if $test -d File; then
22336 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
22337 known_extensions="$known_extensions $1$this_ext";
22338 elif $test -f $xxx/Makefile.PL; then
22339 nonxs_extensions="$nonxs_extensions $1$this_ext";
22341 if $test -d $xxx -a $# -lt 10; then
22344 eval $find_extensions;
22350 echo " $known_extensions $nonxs_extensions" > $$.tmp;
22351 if $contains " $this_ext " $$.tmp; then
22353 echo "Duplicate directories detected for extension $xxx" >&4;
22354 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22355 case "$knowitall" in
22363 echo "Ok. Stopping Configure." >&4;
22364 echo "Please remove the duplicate directory (eg using git clean) and then re-run Configure" >&4;
22367 echo "Ok. You will need to correct config.sh before running make." >&4;
22369 $ls -1 $xxx > $$.tmp;
22370 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22371 known_extensions="$known_extensions $this_ext";
22372 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22373 known_extensions="$known_extensions $this_ext";
22374 elif $test -d $xxx; then
22375 nonxs_extensions="$nonxs_extensions $this_ext";
22386 eval $find_extensions
22390 eval $find_extensions
22394 eval $find_extensions
22395 if $test -d File-Glob; then
22396 : All ext/ flattened
22398 # Special case: Add in modules that nest beyond the first level.
22399 # Currently threads/shared and Hash/Util/FieldHash, since they are
22400 # not picked up by the recursive find above (and adding in general
22401 # recursive finding breaks SDBM_File/sdbm).
22402 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
22403 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
22405 set X $known_extensions
22407 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22408 set X $nonxs_extensions
22410 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22413 : Now see which are supported on this system.
22415 for xxx in $known_extensions ; do
22419 $define) avail_ext="$avail_ext $xxx" ;;
22422 GDBM_File|gdbm_fil)
22424 $define) avail_ext="$avail_ext $xxx" ;;
22427 I18N/Langinfo|i18n_lan)
22428 case "$i_langinfo$d_nl_langinfo" in
22429 $define$define) avail_ext="$avail_ext $xxx" ;;
22433 : XXX Do we need a useipcsysv variable here
22434 case "${d_msg}${d_sem}${d_shm}" in
22435 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22438 NDBM_File|ndbm_fil)
22441 case "$osname-$use64bitint" in
22444 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22447 *) avail_ext="$avail_ext $xxx" ;;
22452 ODBM_File|odbm_fil)
22453 case "${i_dbm}${i_rpcsvcdbm}" in
22455 case "$d_cplusplus" in
22456 define) ;; # delete as a function name will not work
22457 *) case "$osname-$use64bitint" in
22460 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22463 *) avail_ext="$avail_ext $xxx" ;;
22471 case "$useopcode" in
22472 true|define|y) avail_ext="$avail_ext $xxx" ;;
22476 case "$useposix" in
22477 true|define|y) avail_ext="$avail_ext $xxx" ;;
22481 case "$d_socket" in
22482 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22485 Sys/Syslog|sys/syslog)
22486 : XXX syslog requires socket
22487 case "$d_socket" in
22488 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22492 case "$usethreads" in
22494 case "$use5005threads" in
22495 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22499 threads|threads/shared)
22500 # threads and threads::shared are special cases.
22501 # To stop people from asking "Perl 5.8.0 was supposed
22502 # to have this new fancy threads implementation but my
22503 # perl doesn't have it" and from people trying to
22504 # (re)install the threads module using CPAN.pm and
22505 # CPAN.pm then offering to reinstall Perl 5.8.0,
22506 # the threads.pm and threads/shared.pm will always be
22507 # there, croaking informatively ("you need to rebuild
22508 # all of Perl with threads, sorry") when threads haven't
22509 # been compiled in.
22511 avail_ext="$avail_ext $xxx"
22517 cygwin) avail_ext="$avail_ext $xxx" ;;
22520 XS/APItest|xs/apitest)
22521 # This is just for testing. Skip it unless we have dynamic loading.
22524 $define) avail_ext="$avail_ext $xxx" ;;
22527 XS/Typemap|xs/typemap)
22528 # This is just for testing. Skip it unless we have dynamic loading.
22530 $define) avail_ext="$avail_ext $xxx" ;;
22533 *) avail_ext="$avail_ext $xxx"
22542 case "$onlyextensions" in
22544 *) keepextensions=''
22545 echo "You have requested that only certain extensions be included..." >&4
22546 for i in $onlyextensions; do
22547 case " $avail_ext " in
22549 echo "Keeping extension $i."
22550 keepextensions="$keepextensions $i"
22552 *) echo "Ignoring extension $i." ;;
22555 avail_ext="$keepextensions"
22559 case "$noextensions" in
22561 *) keepextensions=''
22562 echo "You have requested that certain extensions be ignored..." >&4
22563 for i in $avail_ext; do
22564 case " $noextensions " in
22565 *" $i "*) echo "Ignoring extension $i." ;;
22566 *) echo "Keeping extension $i.";
22567 keepextensions="$keepextensions $i"
22571 avail_ext="$keepextensions"
22575 : Now see which nonxs extensions are supported on this system.
22576 : For now assume all are.
22578 for xxx in $nonxs_extensions ; do
22580 *) nonxs_ext="$nonxs_ext $xxx"
22592 A number of extensions are supplied with $package. You may choose to
22593 compile these extensions for dynamic loading (the default), compile
22594 them into the $package executable (static loading), or not include
22595 them at all. Answer "none" to include no extensions.
22596 Note that DynaLoader is always built and need not be mentioned here.
22599 case "$dynamic_ext" in
22601 : Exclude those listed in static_ext
22603 for xxx in $avail_ext; do
22604 case " $static_ext " in
22606 *) dflt="$dflt $xxx" ;;
22613 *) dflt="$dynamic_ext"
22614 # Perhaps we are reusing an old out-of-date config.sh.
22617 if test X"$dynamic_ext" != X"$avail_ext"; then
22619 NOTICE: Your previous config.sh list may be incorrect.
22620 The extensions now available to you are
22622 but the default list from your previous config.sh is
22634 rp="What extensions do you wish to load dynamically?"
22637 none) dynamic_ext=' ' ;;
22638 *) dynamic_ext="$ans" ;;
22641 case "$static_ext" in
22643 : Exclude those already listed in dynamic linking
22645 for xxx in $avail_ext; do
22646 case " $dynamic_ext " in
22648 *) dflt="$dflt $xxx" ;;
22655 *) dflt="$static_ext"
22662 rp="What extensions do you wish to load statically?"
22665 none) static_ext=' ' ;;
22666 *) static_ext="$ans" ;;
22671 A number of extensions are supplied with $package. Answer "none"
22672 to include no extensions.
22673 Note that DynaLoader is always built and need not be mentioned here.
22676 case "$static_ext" in
22677 '') dflt="$avail_ext" ;;
22678 *) dflt="$static_ext"
22679 # Perhaps we are reusing an old out-of-date config.sh.
22682 if test X"$static_ext" != X"$avail_ext"; then
22684 NOTICE: Your previous config.sh list may be incorrect.
22685 The extensions now available to you are
22687 but the default list from your previous config.sh is
22696 : Exclude those that are not xs extensions
22700 rp="What extensions do you wish to include?"
22703 none) static_ext=' ' ;;
22704 *) static_ext="$ans" ;;
22709 # Encode is a special case. If we are building Encode as a static
22710 # extension, we need to explicitly list its subextensions as well.
22711 # For other nested extensions, this is handled automatically by
22712 # the appropriate Makefile.PL.
22713 case " $static_ext " in
22714 *" Encode "*) # Add the subextensions of Encode
22716 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22717 static_ext="$static_ext Encode/$xxx"
22723 set X $dynamic_ext $static_ext $nonxs_ext
22727 # Sanity check: We require an extension suitable for use with
22728 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22729 # should show up as failures in the test suite, but it's helpful to
22730 # catch them now.) The 'extensions' list is normally sorted
22731 # alphabetically, so we need to accept either
22732 # DB_File ... Fcntl ... IO ....
22733 # or something like
22734 # Fcntl ... NDBM_File ... IO ....
22735 case " $extensions" in
22736 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22737 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22738 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22739 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22740 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22744 : Remove libraries needed only for extensions
22745 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22746 : The exception is SunOS 4.x, which needs them.
22747 case "${osname}X${osvers}" in
22751 *) case "$usedl" in
22752 $define|true|[yY]*)
22753 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22757 *) perllibs="$libs"
22763 : Remove build directory name from cppstdin so it can be used from
22764 : either the present location or the final installed location.
22766 : Get out of the UU directory to get correct path name.
22768 case "$cppstdin" in
22770 echo "Stripping down cppstdin path name"
22776 : end of configuration questions
22778 echo "End of configuration questions."
22781 : back to where it started
22782 if test -d ../UU; then
22786 : configuration may be unconditionally patched via a 'config.arch' file
22787 if $test -f config.arch; then
22788 echo "I see a config.arch file, loading it." >&4
22792 : configuration may be patched via a 'config.over' file
22793 if $test -f config.over; then
22796 rp='I see a config.over file. Do you wish to load it?'
22799 n*) echo "OK, I'll ignore it.";;
22801 echo "Configuration override changes have been loaded."
22806 : in case they want portability, strip down executable paths
22807 case "$d_portable" in
22810 echo "Stripping down executable paths..." >&4
22811 for file in $loclist $trylist; do
22813 eval $file=`basename $temp`
22818 : create config.sh file
22820 echo "Creating config.sh..." >&4
22821 $spitshell <<EOT >config.sh
22824 # This file was produced by running the Configure script. It holds all the
22825 # definitions figured out by Configure. Should you modify one of these values,
22826 # do not forget to propagate your changes by running "Configure -der". You may
22827 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22830 # Package name : $package
22831 # Source directory : $src
22832 # Configuration time: $cf_time
22833 # Configured by : $cf_by
22834 # Target system : $myuname
22837 : Add in command line options if available
22838 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22840 $spitshell <<EOT >>config.sh
22849 Revision='$Revision'
22857 alignbytes='$alignbytes'
22858 ansi2knr='$ansi2knr'
22859 aphostname='$aphostname'
22860 api_revision='$api_revision'
22861 api_subversion='$api_subversion'
22862 api_version='$api_version'
22863 api_versionstring='$api_versionstring'
22866 archlibexp='$archlibexp'
22867 archname64='$archname64'
22868 archname='$archname'
22869 archobjs='$archobjs'
22870 asctime_r_proto='$asctime_r_proto'
22879 byteorder='$byteorder'
22881 castflags='$castflags'
22884 cccdlflags='$cccdlflags'
22885 ccdlflags='$ccdlflags'
22887 ccflags_uselargefiles='$ccflags_uselargefiles'
22889 ccsymbols='$ccsymbols'
22890 ccversion='$ccversion'
22892 cf_email='$cf_email'
22894 charbits='$charbits'
22895 charsize='$charsize'
22899 clocktype='$clocktype'
22901 compress='$compress'
22902 contains='$contains'
22906 cpp_stuff='$cpp_stuff'
22907 cppccsymbols='$cppccsymbols'
22908 cppflags='$cppflags'
22910 cppminus='$cppminus'
22912 cppstdin='$cppstdin'
22913 cppsymbols='$cppsymbols'
22914 crypt_r_proto='$crypt_r_proto'
22915 cryptlib='$cryptlib'
22917 ctermid_r_proto='$ctermid_r_proto'
22918 ctime_r_proto='$ctime_r_proto'
22919 d_Gconvert='$d_Gconvert'
22920 d_PRIEUldbl='$d_PRIEUldbl'
22921 d_PRIFUldbl='$d_PRIFUldbl'
22922 d_PRIGUldbl='$d_PRIGUldbl'
22923 d_PRIXU64='$d_PRIXU64'
22924 d_PRId64='$d_PRId64'
22925 d_PRIeldbl='$d_PRIeldbl'
22926 d_PRIfldbl='$d_PRIfldbl'
22927 d_PRIgldbl='$d_PRIgldbl'
22928 d_PRIi64='$d_PRIi64'
22929 d_PRIo64='$d_PRIo64'
22930 d_PRIu64='$d_PRIu64'
22931 d_PRIx64='$d_PRIx64'
22932 d_SCNfldbl='$d_SCNfldbl'
22933 d__fwalk='$d__fwalk'
22934 d_access='$d_access'
22935 d_accessx='$d_accessx'
22938 d_archlib='$d_archlib'
22939 d_asctime64='$d_asctime64'
22940 d_asctime_r='$d_asctime_r'
22943 d_attribute_deprecated='$d_attribute_deprecated'
22944 d_attribute_format='$d_attribute_format'
22945 d_attribute_malloc='$d_attribute_malloc'
22946 d_attribute_nonnull='$d_attribute_nonnull'
22947 d_attribute_noreturn='$d_attribute_noreturn'
22948 d_attribute_pure='$d_attribute_pure'
22949 d_attribute_unused='$d_attribute_unused'
22950 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22954 d_bsdgetpgrp='$d_bsdgetpgrp'
22955 d_bsdsetpgrp='$d_bsdsetpgrp'
22956 d_builtin_choose_expr='$d_builtin_choose_expr'
22957 d_builtin_expect='$d_builtin_expect'
22959 d_c99_variadic_macros='$d_c99_variadic_macros'
22960 d_casti32='$d_casti32'
22961 d_castneg='$d_castneg'
22962 d_charvspr='$d_charvspr'
22964 d_chroot='$d_chroot'
22965 d_chsize='$d_chsize'
22967 d_clearenv='$d_clearenv'
22968 d_closedir='$d_closedir'
22969 d_cmsghdr_s='$d_cmsghdr_s'
22971 d_copysignl='$d_copysignl'
22972 d_cplusplus='$d_cplusplus'
22974 d_crypt_r='$d_crypt_r'
22976 d_ctermid='$d_ctermid'
22977 d_ctermid_r='$d_ctermid_r'
22978 d_ctime64='$d_ctime64'
22979 d_ctime_r='$d_ctime_r'
22980 d_cuserid='$d_cuserid'
22981 d_dbl_dig='$d_dbl_dig'
22982 d_dbminitproto='$d_dbminitproto'
22983 d_difftime64='$d_difftime64'
22984 d_difftime='$d_difftime'
22985 d_dir_dd_fd='$d_dir_dd_fd'
22987 d_dirnamlen='$d_dirnamlen'
22988 d_dlerror='$d_dlerror'
22989 d_dlopen='$d_dlopen'
22990 d_dlsymun='$d_dlsymun'
22991 d_dosuid='$d_dosuid'
22992 d_drand48_r='$d_drand48_r'
22993 d_drand48proto='$d_drand48proto'
22995 d_eaccess='$d_eaccess'
22996 d_endgrent='$d_endgrent'
22997 d_endgrent_r='$d_endgrent_r'
22998 d_endhent='$d_endhent'
22999 d_endhostent_r='$d_endhostent_r'
23000 d_endnent='$d_endnent'
23001 d_endnetent_r='$d_endnetent_r'
23002 d_endpent='$d_endpent'
23003 d_endprotoent_r='$d_endprotoent_r'
23004 d_endpwent='$d_endpwent'
23005 d_endpwent_r='$d_endpwent_r'
23006 d_endsent='$d_endsent'
23007 d_endservent_r='$d_endservent_r'
23008 d_eofnblk='$d_eofnblk'
23009 d_eunice='$d_eunice'
23010 d_faststdio='$d_faststdio'
23011 d_fchdir='$d_fchdir'
23012 d_fchmod='$d_fchmod'
23013 d_fchown='$d_fchown'
23015 d_fcntl_can_lock='$d_fcntl_can_lock'
23016 d_fd_macros='$d_fd_macros'
23017 d_fd_set='$d_fd_set'
23018 d_fds_bits='$d_fds_bits'
23019 d_fgetpos='$d_fgetpos'
23020 d_finite='$d_finite'
23021 d_finitel='$d_finitel'
23022 d_flexfnam='$d_flexfnam'
23024 d_flockproto='$d_flockproto'
23026 d_fp_class='$d_fp_class'
23027 d_fpathconf='$d_fpathconf'
23028 d_fpclass='$d_fpclass'
23029 d_fpclassify='$d_fpclassify'
23030 d_fpclassl='$d_fpclassl'
23031 d_fpos64_t='$d_fpos64_t'
23032 d_frexpl='$d_frexpl'
23033 d_fs_data_s='$d_fs_data_s'
23034 d_fseeko='$d_fseeko'
23035 d_fsetpos='$d_fsetpos'
23036 d_fstatfs='$d_fstatfs'
23037 d_fstatvfs='$d_fstatvfs'
23039 d_ftello='$d_ftello'
23041 d_futimes='$d_futimes'
23042 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23043 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23044 d_getaddrinfo='$d_getaddrinfo'
23045 d_getcwd='$d_getcwd'
23046 d_getespwnam='$d_getespwnam'
23047 d_getfsstat='$d_getfsstat'
23048 d_getgrent='$d_getgrent'
23049 d_getgrent_r='$d_getgrent_r'
23050 d_getgrgid_r='$d_getgrgid_r'
23051 d_getgrnam_r='$d_getgrnam_r'
23052 d_getgrps='$d_getgrps'
23053 d_gethbyaddr='$d_gethbyaddr'
23054 d_gethbyname='$d_gethbyname'
23055 d_gethent='$d_gethent'
23056 d_gethname='$d_gethname'
23057 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23058 d_gethostbyname_r='$d_gethostbyname_r'
23059 d_gethostent_r='$d_gethostent_r'
23060 d_gethostprotos='$d_gethostprotos'
23061 d_getitimer='$d_getitimer'
23062 d_getlogin='$d_getlogin'
23063 d_getlogin_r='$d_getlogin_r'
23064 d_getmnt='$d_getmnt'
23065 d_getmntent='$d_getmntent'
23066 d_getnameinfo='$d_getnameinfo'
23067 d_getnbyaddr='$d_getnbyaddr'
23068 d_getnbyname='$d_getnbyname'
23069 d_getnent='$d_getnent'
23070 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23071 d_getnetbyname_r='$d_getnetbyname_r'
23072 d_getnetent_r='$d_getnetent_r'
23073 d_getnetprotos='$d_getnetprotos'
23074 d_getpagsz='$d_getpagsz'
23075 d_getpbyname='$d_getpbyname'
23076 d_getpbynumber='$d_getpbynumber'
23077 d_getpent='$d_getpent'
23078 d_getpgid='$d_getpgid'
23079 d_getpgrp2='$d_getpgrp2'
23080 d_getpgrp='$d_getpgrp'
23081 d_getppid='$d_getppid'
23082 d_getprior='$d_getprior'
23083 d_getprotobyname_r='$d_getprotobyname_r'
23084 d_getprotobynumber_r='$d_getprotobynumber_r'
23085 d_getprotoent_r='$d_getprotoent_r'
23086 d_getprotoprotos='$d_getprotoprotos'
23087 d_getprpwnam='$d_getprpwnam'
23088 d_getpwent='$d_getpwent'
23089 d_getpwent_r='$d_getpwent_r'
23090 d_getpwnam_r='$d_getpwnam_r'
23091 d_getpwuid_r='$d_getpwuid_r'
23092 d_getsbyname='$d_getsbyname'
23093 d_getsbyport='$d_getsbyport'
23094 d_getsent='$d_getsent'
23095 d_getservbyname_r='$d_getservbyname_r'
23096 d_getservbyport_r='$d_getservbyport_r'
23097 d_getservent_r='$d_getservent_r'
23098 d_getservprotos='$d_getservprotos'
23099 d_getspnam='$d_getspnam'
23100 d_getspnam_r='$d_getspnam_r'
23101 d_gettimeod='$d_gettimeod'
23102 d_gmtime64='$d_gmtime64'
23103 d_gmtime_r='$d_gmtime_r'
23104 d_gnulibc='$d_gnulibc'
23105 d_grpasswd='$d_grpasswd'
23106 d_hasmntopt='$d_hasmntopt'
23108 d_ilogbl='$d_ilogbl'
23109 d_inc_version_list='$d_inc_version_list'
23111 d_inetaton='$d_inetaton'
23112 d_inetntop='$d_inetntop'
23113 d_inetpton='$d_inetpton'
23114 d_int64_t='$d_int64_t'
23115 d_ip_mreq='$d_ip_mreq'
23116 d_ip_mreq_source='$d_ip_mreq_source'
23117 d_ipv6_mreq='$d_ipv6_mreq'
23118 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23119 d_isascii='$d_isascii'
23120 d_isblank='$d_isblank'
23121 d_isfinite='$d_isfinite'
23124 d_isnanl='$d_isnanl'
23125 d_killpg='$d_killpg'
23126 d_lchown='$d_lchown'
23127 d_ldbl_dig='$d_ldbl_dig'
23128 d_libm_lib_version='$d_libm_lib_version'
23130 d_localtime64='$d_localtime64'
23131 d_localtime_r='$d_localtime_r'
23132 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23133 d_locconv='$d_locconv'
23135 d_longdbl='$d_longdbl'
23136 d_longlong='$d_longlong'
23137 d_lseekproto='$d_lseekproto'
23139 d_madvise='$d_madvise'
23140 d_malloc_good_size='$d_malloc_good_size'
23141 d_malloc_size='$d_malloc_size'
23143 d_mbstowcs='$d_mbstowcs'
23144 d_mbtowc='$d_mbtowc'
23145 d_memchr='$d_memchr'
23146 d_memcmp='$d_memcmp'
23147 d_memcpy='$d_memcpy'
23148 d_memmove='$d_memmove'
23149 d_memset='$d_memset'
23151 d_mkdtemp='$d_mkdtemp'
23152 d_mkfifo='$d_mkfifo'
23153 d_mkstemp='$d_mkstemp'
23154 d_mkstemps='$d_mkstemps'
23155 d_mktime64='$d_mktime64'
23156 d_mktime='$d_mktime'
23159 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23160 d_modflproto='$d_modflproto'
23161 d_mprotect='$d_mprotect'
23163 d_msg_ctrunc='$d_msg_ctrunc'
23164 d_msg_dontroute='$d_msg_dontroute'
23165 d_msg_oob='$d_msg_oob'
23166 d_msg_peek='$d_msg_peek'
23167 d_msg_proxy='$d_msg_proxy'
23168 d_msgctl='$d_msgctl'
23169 d_msgget='$d_msgget'
23170 d_msghdr_s='$d_msghdr_s'
23171 d_msgrcv='$d_msgrcv'
23172 d_msgsnd='$d_msgsnd'
23174 d_munmap='$d_munmap'
23175 d_mymalloc='$d_mymalloc'
23177 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23179 d_nl_langinfo='$d_nl_langinfo'
23180 d_nv_preserves_uv='$d_nv_preserves_uv'
23181 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23182 d_off64_t='$d_off64_t'
23183 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23184 d_oldpthreads='$d_oldpthreads'
23185 d_oldsock='$d_oldsock'
23187 d_pathconf='$d_pathconf'
23189 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23190 d_phostname='$d_phostname'
23193 d_portable='$d_portable'
23195 d_prctl_set_name='$d_prctl_set_name'
23196 d_printf_format_null='$d_printf_format_null'
23197 d_procselfexe='$d_procselfexe'
23198 d_pseudofork='$d_pseudofork'
23199 d_pthread_atfork='$d_pthread_atfork'
23200 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23201 d_pthread_yield='$d_pthread_yield'
23203 d_pwchange='$d_pwchange'
23204 d_pwclass='$d_pwclass'
23205 d_pwcomment='$d_pwcomment'
23206 d_pwexpire='$d_pwexpire'
23207 d_pwgecos='$d_pwgecos'
23208 d_pwpasswd='$d_pwpasswd'
23209 d_pwquota='$d_pwquota'
23212 d_random_r='$d_random_r'
23213 d_readdir64_r='$d_readdir64_r'
23214 d_readdir='$d_readdir'
23215 d_readdir_r='$d_readdir_r'
23216 d_readlink='$d_readlink'
23218 d_recvmsg='$d_recvmsg'
23219 d_rename='$d_rename'
23220 d_rewinddir='$d_rewinddir'
23222 d_safebcpy='$d_safebcpy'
23223 d_safemcpy='$d_safemcpy'
23224 d_sanemcmp='$d_sanemcmp'
23225 d_sbrkproto='$d_sbrkproto'
23226 d_scalbnl='$d_scalbnl'
23227 d_sched_yield='$d_sched_yield'
23228 d_scm_rights='$d_scm_rights'
23229 d_seekdir='$d_seekdir'
23230 d_select='$d_select'
23232 d_semctl='$d_semctl'
23233 d_semctl_semid_ds='$d_semctl_semid_ds'
23234 d_semctl_semun='$d_semctl_semun'
23235 d_semget='$d_semget'
23237 d_sendmsg='$d_sendmsg'
23238 d_setegid='$d_setegid'
23239 d_seteuid='$d_seteuid'
23240 d_setgrent='$d_setgrent'
23241 d_setgrent_r='$d_setgrent_r'
23242 d_setgrps='$d_setgrps'
23243 d_sethent='$d_sethent'
23244 d_sethostent_r='$d_sethostent_r'
23245 d_setitimer='$d_setitimer'
23246 d_setlinebuf='$d_setlinebuf'
23247 d_setlocale='$d_setlocale'
23248 d_setlocale_r='$d_setlocale_r'
23249 d_setnent='$d_setnent'
23250 d_setnetent_r='$d_setnetent_r'
23251 d_setpent='$d_setpent'
23252 d_setpgid='$d_setpgid'
23253 d_setpgrp2='$d_setpgrp2'
23254 d_setpgrp='$d_setpgrp'
23255 d_setprior='$d_setprior'
23256 d_setproctitle='$d_setproctitle'
23257 d_setprotoent_r='$d_setprotoent_r'
23258 d_setpwent='$d_setpwent'
23259 d_setpwent_r='$d_setpwent_r'
23260 d_setregid='$d_setregid'
23261 d_setresgid='$d_setresgid'
23262 d_setresuid='$d_setresuid'
23263 d_setreuid='$d_setreuid'
23264 d_setrgid='$d_setrgid'
23265 d_setruid='$d_setruid'
23266 d_setsent='$d_setsent'
23267 d_setservent_r='$d_setservent_r'
23268 d_setsid='$d_setsid'
23269 d_setvbuf='$d_setvbuf'
23273 d_shmatprototype='$d_shmatprototype'
23274 d_shmctl='$d_shmctl'
23276 d_shmget='$d_shmget'
23277 d_sigaction='$d_sigaction'
23278 d_signbit='$d_signbit'
23279 d_sigprocmask='$d_sigprocmask'
23280 d_sigsetjmp='$d_sigsetjmp'
23281 d_sin6_scope_id='$d_sin6_scope_id'
23282 d_sitearch='$d_sitearch'
23283 d_snprintf='$d_snprintf'
23284 d_sockaddr_in6='$d_sockaddr_in6'
23285 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23286 d_sockatmark='$d_sockatmark'
23287 d_sockatmarkproto='$d_sockatmarkproto'
23288 d_socket='$d_socket'
23289 d_socklen_t='$d_socklen_t'
23290 d_sockpair='$d_sockpair'
23291 d_socks5_init='$d_socks5_init'
23292 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23294 d_srand48_r='$d_srand48_r'
23295 d_srandom_r='$d_srandom_r'
23296 d_sresgproto='$d_sresgproto'
23297 d_sresuproto='$d_sresuproto'
23298 d_statblks='$d_statblks'
23299 d_statfs_f_flags='$d_statfs_f_flags'
23300 d_statfs_s='$d_statfs_s'
23301 d_static_inline='$d_static_inline'
23302 d_statvfs='$d_statvfs'
23303 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23304 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23305 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23306 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23307 d_stdio_stream_array='$d_stdio_stream_array'
23308 d_stdiobase='$d_stdiobase'
23309 d_stdstdio='$d_stdstdio'
23310 d_strchr='$d_strchr'
23311 d_strcoll='$d_strcoll'
23312 d_strctcpy='$d_strctcpy'
23313 d_strerrm='$d_strerrm'
23314 d_strerror='$d_strerror'
23315 d_strerror_r='$d_strerror_r'
23316 d_strftime='$d_strftime'
23317 d_strlcat='$d_strlcat'
23318 d_strlcpy='$d_strlcpy'
23319 d_strtod='$d_strtod'
23320 d_strtol='$d_strtol'
23321 d_strtold='$d_strtold'
23322 d_strtoll='$d_strtoll'
23323 d_strtoq='$d_strtoq'
23324 d_strtoul='$d_strtoul'
23325 d_strtoull='$d_strtoull'
23326 d_strtouq='$d_strtouq'
23327 d_strxfrm='$d_strxfrm'
23328 d_suidsafe='$d_suidsafe'
23329 d_symlink='$d_symlink'
23330 d_syscall='$d_syscall'
23331 d_syscallproto='$d_syscallproto'
23332 d_sysconf='$d_sysconf'
23333 d_sysernlst='$d_sysernlst'
23334 d_syserrlst='$d_syserrlst'
23335 d_system='$d_system'
23336 d_tcgetpgrp='$d_tcgetpgrp'
23337 d_tcsetpgrp='$d_tcsetpgrp'
23338 d_telldir='$d_telldir'
23339 d_telldirproto='$d_telldirproto'
23341 d_timegm='$d_timegm'
23343 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23344 d_tm_tm_zone='$d_tm_tm_zone'
23345 d_tmpnam_r='$d_tmpnam_r'
23346 d_truncate='$d_truncate'
23347 d_ttyname_r='$d_ttyname_r'
23348 d_tzname='$d_tzname'
23349 d_u32align='$d_u32align'
23350 d_ualarm='$d_ualarm'
23353 d_union_semun='$d_union_semun'
23354 d_unordered='$d_unordered'
23355 d_unsetenv='$d_unsetenv'
23356 d_usleep='$d_usleep'
23357 d_usleepproto='$d_usleepproto'
23359 d_vendorarch='$d_vendorarch'
23360 d_vendorbin='$d_vendorbin'
23361 d_vendorlib='$d_vendorlib'
23362 d_vendorscript='$d_vendorscript'
23364 d_void_closedir='$d_void_closedir'
23365 d_voidsig='$d_voidsig'
23366 d_voidtty='$d_voidtty'
23367 d_volatile='$d_volatile'
23368 d_vprintf='$d_vprintf'
23369 d_vsnprintf='$d_vsnprintf'
23371 d_waitpid='$d_waitpid'
23372 d_wcstombs='$d_wcstombs'
23373 d_wctomb='$d_wctomb'
23374 d_writev='$d_writev'
23377 db_hashtype='$db_hashtype'
23378 db_prefixtype='$db_prefixtype'
23379 db_version_major='$db_version_major'
23380 db_version_minor='$db_version_minor'
23381 db_version_patch='$db_version_patch'
23382 defvoidused='$defvoidused'
23383 direntrytype='$direntrytype'
23386 doublesize='$doublesize'
23388 drand48_r_proto='$drand48_r_proto'
23390 dynamic_ext='$dynamic_ext'
23396 endgrent_r_proto='$endgrent_r_proto'
23397 endhostent_r_proto='$endhostent_r_proto'
23398 endnetent_r_proto='$endnetent_r_proto'
23399 endprotoent_r_proto='$endprotoent_r_proto'
23400 endpwent_r_proto='$endpwent_r_proto'
23401 endservent_r_proto='$endservent_r_proto'
23402 eunicefix='$eunicefix'
23405 extensions='$extensions'
23406 extern_C='$extern_C'
23408 fflushNULL='$fflushNULL'
23409 fflushall='$fflushall'
23411 firstmakefile='$firstmakefile'
23413 fpossize='$fpossize'
23414 fpostype='$fpostype'
23415 freetype='$freetype'
23418 full_csh='$full_csh'
23419 full_sed='$full_sed'
23420 gccansipedantic='$gccansipedantic'
23421 gccosandvers='$gccosandvers'
23422 gccversion='$gccversion'
23423 getgrent_r_proto='$getgrent_r_proto'
23424 getgrgid_r_proto='$getgrgid_r_proto'
23425 getgrnam_r_proto='$getgrnam_r_proto'
23426 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23427 gethostbyname_r_proto='$gethostbyname_r_proto'
23428 gethostent_r_proto='$gethostent_r_proto'
23429 getlogin_r_proto='$getlogin_r_proto'
23430 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23431 getnetbyname_r_proto='$getnetbyname_r_proto'
23432 getnetent_r_proto='$getnetent_r_proto'
23433 getprotobyname_r_proto='$getprotobyname_r_proto'
23434 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23435 getprotoent_r_proto='$getprotoent_r_proto'
23436 getpwent_r_proto='$getpwent_r_proto'
23437 getpwnam_r_proto='$getpwnam_r_proto'
23438 getpwuid_r_proto='$getpwuid_r_proto'
23439 getservbyname_r_proto='$getservbyname_r_proto'
23440 getservbyport_r_proto='$getservbyport_r_proto'
23441 getservent_r_proto='$getservent_r_proto'
23442 getspnam_r_proto='$getspnam_r_proto'
23443 gidformat='$gidformat'
23449 gmtime_r_proto='$gmtime_r_proto'
23450 gnulibc_version='$gnulibc_version'
23452 groupcat='$groupcat'
23453 groupstype='$groupstype'
23456 h_sysfile='$h_sysfile'
23459 html1dir='$html1dir'
23460 html1direxp='$html1direxp'
23461 html3dir='$html3dir'
23462 html3direxp='$html3direxp'
23471 i_arpainet='$i_arpainet'
23472 i_assert='$i_assert'
23473 i_bsdioctl='$i_bsdioctl'
23477 i_dirent='$i_dirent'
23483 i_fp_class='$i_fp_class'
23485 i_gdbm_ndbm='$i_gdbm_ndbm'
23486 i_gdbmndbm='$i_gdbmndbm'
23488 i_ieeefp='$i_ieeefp'
23489 i_inttypes='$i_inttypes'
23490 i_langinfo='$i_langinfo'
23491 i_libutil='$i_libutil'
23492 i_limits='$i_limits'
23493 i_locale='$i_locale'
23494 i_machcthr='$i_machcthr'
23495 i_malloc='$i_malloc'
23496 i_mallocmalloc='$i_mallocmalloc'
23498 i_memory='$i_memory'
23499 i_mntent='$i_mntent'
23502 i_neterrno='$i_neterrno'
23503 i_netinettcp='$i_netinettcp'
23507 i_pthread='$i_pthread'
23509 i_rpcsvcdbm='$i_rpcsvcdbm'
23512 i_shadow='$i_shadow'
23514 i_stdarg='$i_stdarg'
23515 i_stdbool='$i_stdbool'
23516 i_stddef='$i_stddef'
23517 i_stdlib='$i_stdlib'
23518 i_string='$i_string'
23519 i_sunmath='$i_sunmath'
23520 i_sysaccess='$i_sysaccess'
23521 i_sysdir='$i_sysdir'
23522 i_sysfile='$i_sysfile'
23523 i_sysfilio='$i_sysfilio'
23525 i_sysioctl='$i_sysioctl'
23526 i_syslog='$i_syslog'
23527 i_sysmman='$i_sysmman'
23528 i_sysmode='$i_sysmode'
23529 i_sysmount='$i_sysmount'
23530 i_sysndir='$i_sysndir'
23531 i_sysparam='$i_sysparam'
23532 i_syspoll='$i_syspoll'
23533 i_sysresrc='$i_sysresrc'
23534 i_syssecrt='$i_syssecrt'
23535 i_sysselct='$i_sysselct'
23536 i_syssockio='$i_syssockio'
23537 i_sysstat='$i_sysstat'
23538 i_sysstatfs='$i_sysstatfs'
23539 i_sysstatvfs='$i_sysstatvfs'
23540 i_systime='$i_systime'
23541 i_systimek='$i_systimek'
23542 i_systimes='$i_systimes'
23543 i_systypes='$i_systypes'
23544 i_sysuio='$i_sysuio'
23546 i_sysutsname='$i_sysutsname'
23547 i_sysvfs='$i_sysvfs'
23548 i_syswait='$i_syswait'
23549 i_termio='$i_termio'
23550 i_termios='$i_termios'
23552 i_unistd='$i_unistd'
23555 i_values='$i_values'
23556 i_varargs='$i_varargs'
23557 i_varhdr='$i_varhdr'
23559 ignore_versioned_solibs='$ignore_versioned_solibs'
23560 inc_version_list='$inc_version_list'
23561 inc_version_list_init='$inc_version_list_init'
23564 initialinstalllocation='$initialinstalllocation'
23565 installarchlib='$installarchlib'
23566 installbin='$installbin'
23567 installhtml1dir='$installhtml1dir'
23568 installhtml3dir='$installhtml3dir'
23569 installman1dir='$installman1dir'
23570 installman3dir='$installman3dir'
23571 installprefix='$installprefix'
23572 installprefixexp='$installprefixexp'
23573 installprivlib='$installprivlib'
23574 installscript='$installscript'
23575 installsitearch='$installsitearch'
23576 installsitebin='$installsitebin'
23577 installsitehtml1dir='$installsitehtml1dir'
23578 installsitehtml3dir='$installsitehtml3dir'
23579 installsitelib='$installsitelib'
23580 installsiteman1dir='$installsiteman1dir'
23581 installsiteman3dir='$installsiteman3dir'
23582 installsitescript='$installsitescript'
23583 installstyle='$installstyle'
23584 installusrbinperl='$installusrbinperl'
23585 installvendorarch='$installvendorarch'
23586 installvendorbin='$installvendorbin'
23587 installvendorhtml1dir='$installvendorhtml1dir'
23588 installvendorhtml3dir='$installvendorhtml3dir'
23589 installvendorlib='$installvendorlib'
23590 installvendorman1dir='$installvendorman1dir'
23591 installvendorman3dir='$installvendorman3dir'
23592 installvendorscript='$installvendorscript'
23594 issymlink='$issymlink'
23595 ivdformat='$ivdformat'
23598 known_extensions='$known_extensions'
23601 ld_can_script='$ld_can_script'
23602 lddlflags='$lddlflags'
23604 ldflags_uselargefiles='$ldflags_uselargefiles'
23605 ldlibpthname='$ldlibpthname'
23612 libsdirs='$libsdirs'
23613 libsfiles='$libsfiles'
23614 libsfound='$libsfound'
23615 libspath='$libspath'
23616 libswanted='$libswanted'
23617 libswanted_uselargefiles='$libswanted_uselargefiles'
23623 localtime_r_proto='$localtime_r_proto'
23624 locincpth='$locincpth'
23625 loclibpth='$loclibpth'
23626 longdblsize='$longdblsize'
23627 longlongsize='$longlongsize'
23628 longsize='$longsize'
23632 lseeksize='$lseeksize'
23633 lseektype='$lseektype'
23636 madlyobj='$madlyobj'
23637 madlysrc='$madlysrc'
23641 make_set_make='$make_set_make'
23642 mallocobj='$mallocobj'
23643 mallocsrc='$mallocsrc'
23644 malloctype='$malloctype'
23646 man1direxp='$man1direxp'
23649 man3direxp='$man3direxp'
23651 mips_type='$mips_type'
23652 mistrustnm='$mistrustnm'
23654 mmaptype='$mmaptype'
23655 modetype='$modetype'
23657 multiarch='$multiarch'
23659 myarchname='$myarchname'
23660 mydomain='$mydomain'
23661 myhostname='$myhostname'
23664 need_va_copy='$need_va_copy'
23665 netdb_hlen_type='$netdb_hlen_type'
23666 netdb_host_type='$netdb_host_type'
23667 netdb_name_type='$netdb_name_type'
23668 netdb_net_type='$netdb_net_type'
23671 nm_so_opt='$nm_so_opt'
23672 nonxs_ext='$nonxs_ext'
23674 nvEUformat='$nvEUformat'
23675 nvFUformat='$nvFUformat'
23676 nvGUformat='$nvGUformat'
23677 nv_overflows_integers_at='$nv_overflows_integers_at'
23678 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23679 nveformat='$nveformat'
23680 nvfformat='$nvfformat'
23681 nvgformat='$nvgformat'
23684 o_nonblock='$o_nonblock'
23686 old_pthread_create_joinable='$old_pthread_create_joinable'
23687 optimize='$optimize'
23688 orderlib='$orderlib'
23691 otherlibdirs='$otherlibdirs'
23695 patchlevel='$patchlevel'
23696 path_sep='$path_sep'
23699 perl_patchlevel='$perl_patchlevel'
23700 perl_static_inline='$perl_static_inline'
23701 perladmin='$perladmin'
23702 perllibs='$perllibs'
23703 perlpath='$perlpath'
23705 phostname='$phostname'
23711 prefixexp='$prefixexp'
23713 privlibexp='$privlibexp'
23714 procselfexe='$procselfexe'
23715 prototype='$prototype'
23717 quadkind='$quadkind'
23718 quadtype='$quadtype'
23719 randbits='$randbits'
23720 randfunc='$randfunc'
23721 random_r_proto='$random_r_proto'
23722 randseedtype='$randseedtype'
23724 rd_nodata='$rd_nodata'
23725 readdir64_r_proto='$readdir64_r_proto'
23726 readdir_r_proto='$readdir_r_proto'
23727 revision='$revision'
23733 sGMTIME_max='$sGMTIME_max'
23734 sGMTIME_min='$sGMTIME_min'
23735 sLOCALTIME_max='$sLOCALTIME_max'
23736 sLOCALTIME_min='$sLOCALTIME_min'
23737 sPRIEUldbl='$sPRIEUldbl'
23738 sPRIFUldbl='$sPRIFUldbl'
23739 sPRIGUldbl='$sPRIGUldbl'
23740 sPRIXU64='$sPRIXU64'
23742 sPRIeldbl='$sPRIeldbl'
23743 sPRIfldbl='$sPRIfldbl'
23744 sPRIgldbl='$sPRIgldbl'
23749 sSCNfldbl='$sSCNfldbl'
23750 sched_yield='$sched_yield'
23751 scriptdir='$scriptdir'
23752 scriptdirexp='$scriptdirexp'
23754 seedfunc='$seedfunc'
23755 selectminbits='$selectminbits'
23756 selecttype='$selecttype'
23757 sendmail='$sendmail'
23758 setgrent_r_proto='$setgrent_r_proto'
23759 sethostent_r_proto='$sethostent_r_proto'
23760 setlocale_r_proto='$setlocale_r_proto'
23761 setnetent_r_proto='$setnetent_r_proto'
23762 setprotoent_r_proto='$setprotoent_r_proto'
23763 setpwent_r_proto='$setpwent_r_proto'
23764 setservent_r_proto='$setservent_r_proto'
23767 sharpbang='$sharpbang'
23768 shmattype='$shmattype'
23769 shortsize='$shortsize'
23772 sig_count='$sig_count'
23773 sig_name='$sig_name'
23774 sig_name_init='$sig_name_init'
23776 sig_num_init='$sig_num_init'
23777 sig_size='$sig_size'
23778 signal_t='$signal_t'
23779 sitearch='$sitearch'
23780 sitearchexp='$sitearchexp'
23782 sitebinexp='$sitebinexp'
23783 sitehtml1dir='$sitehtml1dir'
23784 sitehtml1direxp='$sitehtml1direxp'
23785 sitehtml3dir='$sitehtml3dir'
23786 sitehtml3direxp='$sitehtml3direxp'
23788 sitelib_stem='$sitelib_stem'
23789 sitelibexp='$sitelibexp'
23790 siteman1dir='$siteman1dir'
23791 siteman1direxp='$siteman1direxp'
23792 siteman3dir='$siteman3dir'
23793 siteman3direxp='$siteman3direxp'
23794 siteprefix='$siteprefix'
23795 siteprefixexp='$siteprefixexp'
23796 sitescript='$sitescript'
23797 sitescriptexp='$sitescriptexp'
23798 sizesize='$sizesize'
23799 sizetype='$sizetype'
23803 sockethdr='$sockethdr'
23804 socketlib='$socketlib'
23805 socksizetype='$socksizetype'
23807 spackage='$spackage'
23808 spitshell='$spitshell'
23809 srand48_r_proto='$srand48_r_proto'
23810 srandom_r_proto='$srandom_r_proto'
23812 ssizetype='$ssizetype'
23813 st_ino_sign='$st_ino_sign'
23814 st_ino_size='$st_ino_size'
23815 startperl='$startperl'
23817 static_ext='$static_ext'
23819 stdio_base='$stdio_base'
23820 stdio_bufsiz='$stdio_bufsiz'
23821 stdio_cnt='$stdio_cnt'
23822 stdio_filbuf='$stdio_filbuf'
23823 stdio_ptr='$stdio_ptr'
23824 stdio_stream_array='$stdio_stream_array'
23825 strerror_r_proto='$strerror_r_proto'
23828 subversion='$subversion'
23832 targetarch='$targetarch'
23836 timeincl='$timeincl'
23837 timetype='$timetype'
23838 tmpnam_r_proto='$tmpnam_r_proto'
23844 ttyname_r_proto='$ttyname_r_proto'
23853 uidformat='$uidformat'
23859 uquadtype='$uquadtype'
23860 use5005threads='$use5005threads'
23861 use64bitall='$use64bitall'
23862 use64bitint='$use64bitint'
23863 usecrosscompile='$usecrosscompile'
23864 usedevel='$usedevel'
23866 usedtrace='$usedtrace'
23867 usefaststdio='$usefaststdio'
23868 useithreads='$useithreads'
23869 usekernprocpathname='$usekernprocpathname'
23870 uselargefiles='$uselargefiles'
23871 uselongdouble='$uselongdouble'
23872 usemallocwrap='$usemallocwrap'
23873 usemorebits='$usemorebits'
23874 usemultiplicity='$usemultiplicity'
23875 usemymalloc='$usemymalloc'
23877 usensgetexecutablepath='$usensgetexecutablepath'
23878 useopcode='$useopcode'
23879 useperlio='$useperlio'
23880 useposix='$useposix'
23881 usereentrant='$usereentrant'
23882 userelocatableinc='$userelocatableinc'
23884 useshrplib='$useshrplib'
23885 usesitecustomize='$usesitecustomize'
23886 usesocks='$usesocks'
23887 usethreads='$usethreads'
23888 usevendorprefix='$usevendorprefix'
23889 useversionedarchname='$useversionedarchname'
23890 usevfork='$usevfork'
23893 uvXUformat='$uvXUformat'
23894 uvoformat='$uvoformat'
23897 uvuformat='$uvuformat'
23898 uvxformat='$uvxformat'
23900 vendorarch='$vendorarch'
23901 vendorarchexp='$vendorarchexp'
23902 vendorbin='$vendorbin'
23903 vendorbinexp='$vendorbinexp'
23904 vendorhtml1dir='$vendorhtml1dir'
23905 vendorhtml1direxp='$vendorhtml1direxp'
23906 vendorhtml3dir='$vendorhtml3dir'
23907 vendorhtml3direxp='$vendorhtml3direxp'
23908 vendorlib='$vendorlib'
23909 vendorlib_stem='$vendorlib_stem'
23910 vendorlibexp='$vendorlibexp'
23911 vendorman1dir='$vendorman1dir'
23912 vendorman1direxp='$vendorman1direxp'
23913 vendorman3dir='$vendorman3dir'
23914 vendorman3direxp='$vendorman3direxp'
23915 vendorprefix='$vendorprefix'
23916 vendorprefixexp='$vendorprefixexp'
23917 vendorscript='$vendorscript'
23918 vendorscriptexp='$vendorscriptexp'
23920 version_patchlevel_string='$version_patchlevel_string'
23921 versiononly='$versiononly'
23923 voidflags='$voidflags'
23926 yaccflags='$yaccflags'
23931 : add special variables
23932 $test -f $src/patchlevel.h && \
23933 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23934 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23935 echo "PERL_CONFIG_SH=true" >>config.sh
23937 : propagate old symbols
23938 if $test -f UU/config.sh; then
23939 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23940 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23941 config.sh config.sh UU/oldconfig.sh |\
23942 $sort | $uniq -u >UU/oldsyms
23943 set X `$cat UU/oldsyms`
23949 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23951 echo ": Variables propagated from previous config.sh file." >>config.sh
23952 for sym in `$cat UU/oldsyms`; do
23953 echo " Propagating $hint variable "'$'"$sym..."
23954 eval 'tmp="$'"${sym}"'"'
23956 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23962 : Finish up by extracting the .SH files
23966 echo "Extraction done."
23976 If you'd like to make any changes to the config.sh file before I begin
23977 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23980 rp="Press return or use a shell escape to edit config.sh:"
23985 *) : in case they cannot read
23986 sh 1>&4 -c "$ans";;
23991 : if this fails, just run all the .SH files by hand
24000 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24007 Now you need to generate make dependencies by running "$make depend".
24008 You might prefer to run it in background: "$make depend > makedepend.out &"
24009 It can take a while, so you might not want to run it right now.
24014 rp="Run $make depend now?"
24018 $make depend && echo "Now you must run '$make'."
24021 echo "You must run '$make depend' then '$make'."
24024 elif test -f [Mm]akefile; then
24026 echo "Now you must run a $make."
24028 echo "Configure done."
24031 if $test -f Policy.sh; then
24034 If you compile $package on a different machine or from a different object
24035 directory, copy the Policy.sh file from this object directory to the
24036 new one before you run Configure -- this will help you with most of
24037 the policy defaults.
24041 if $test -f config.msg; then
24042 echo "Hmm. I also noted the following information while running:"
24044 $cat config.msg >&4
24047 $rm -f kit*isdone ark*isdone