3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.code.sf.net/p/dist/code/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated using [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 ) 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
344 useversionedarchname=''
350 initialinstalllocation=''
380 d_attribute_deprecated=''
381 d_attribute_format=''
382 d_attribute_malloc=''
383 d_attribute_nonnull=''
384 d_attribute_noreturn=''
386 d_attribute_unused=''
387 d_attribute_warn_unused_result=''
388 d_printf_format_null=''
392 d_builtin_choose_expr=''
395 d_c99_variadic_macros=''
443 endhostent_r_proto=''
449 endprotoent_r_proto=''
455 endservent_r_proto=''
512 gethostbyaddr_r_proto=''
514 gethostbyname_r_proto=''
516 gethostent_r_proto=''
529 getnetbyaddr_r_proto=''
531 getnetbyname_r_proto=''
545 d_getprotobyname_r=''
546 getprotobyname_r_proto=''
547 d_getprotobynumber_r=''
548 getprotobynumber_r_proto=''
550 getprotoent_r_proto=''
562 getservbyname_r_proto=''
564 getservbyport_r_proto=''
566 getservent_r_proto=''
597 d_libm_lib_version=''
600 d_localtime_r_needs_tzset=''
613 d_malloc_good_size=''
657 d_old_pthread_create_joinable=''
658 old_pthread_create_joinable=''
660 d_pthread_attr_setscope=''
700 sethostent_r_proto=''
717 setprotoent_r_proto=''
729 setservent_r_proto=''
751 d_ipv6_mreq_source=''
768 d_sprintf_returns_strlen=''
780 perl_static_inline=''
785 d_stdio_ptr_lval_nochange_cnt=''
786 d_stdio_ptr_lval_sets_cnt=''
935 d_gdbm_ndbm_h_uses_prototypes=''
936 d_gdbmndbm_h_uses_prototypes=''
938 d_ndbm_h_uses_prototypes=''
1013 d_inc_version_list=''
1015 inc_version_list_init=''
1019 installusrbinperl=''
1035 ignore_versioned_solibs=''
1095 d_perl_otherlibdirs=''
1103 api_versionstring=''
1109 version_patchlevel_string=''
1113 d_nv_preserves_uv=''
1114 d_nv_zero_is_allbits_zero=''
1125 nv_overflows_integers_at=''
1126 nv_preserves_uv_bits=''
1199 installsitehtml1dir=''
1202 installsitehtml3dir=''
1209 installsiteman1dir=''
1212 installsiteman3dir=''
1217 installsitescript=''
1235 d_stdio_stream_array=''
1236 stdio_stream_array=''
1254 usekernprocpathname=''
1255 ccflags_uselargefiles=''
1256 ldflags_uselargefiles=''
1257 libswanted_uselargefiles=''
1266 usensgetexecutablepath=''
1279 installvendorarch=''
1286 installvendorhtml1dir=''
1288 vendorhtml1direxp=''
1289 installvendorhtml3dir=''
1291 vendorhtml3direxp=''
1297 installvendorman1dir=''
1300 installvendorman3dir=''
1307 installvendorscript=''
1318 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1321 : We must find out about Eunice early
1323 if test -f /etc/unixtovms; then
1324 eunicefix=/etc/unixtovms
1326 if test -f /etc/unixtovms.exe; then
1327 eunicefix=/etc/unixtovms.exe
1330 : Set executable suffix now -- needed before hints available
1331 if test -f "/libs/version.library"; then
1334 elif test -f "/system/gnu_library/bin/ar.pm"; then
1337 elif test -n "$DJGPP"; then
1340 elif test -f /kern/cookiejar; then
1343 elif test -d c:/. -o -n "$is_os2" ; then
1350 : Trailing extension. Override this in a hint file, if needed.
1351 : Extra object files, if any, needed on this platform.
1354 : Possible local include directories to search.
1355 : Set locincpth to "" in a hint file to defeat local include searches.
1356 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1357 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1359 : no include file wanted by default
1362 : Enable -DEBUGGING and -DDEBUGGING from the command line
1367 : change the next line if compiling for Xenix/286 on Xenix/386
1368 xlibpth='/usr/lib/386 /lib/386'
1369 : Possible local library directories to search.
1370 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1371 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1373 : general looking path for locating libraries
1374 glibpth="/lib /usr/lib $xlibpth"
1375 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1376 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1377 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1378 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1380 : Private path used by Configure to find libraries. Its value
1381 : is prepended to libpth. This variable takes care of special
1382 : machines, like the mips. Usually, it should be empty.
1385 : default library list
1387 : some systems want to use only the non-versioned libso:s
1388 ignore_versioned_solibs=''
1389 : set usethreads on the Configure command line to enable threads.
1390 usereentrant='undef'
1394 : set useposix=false in your hint file to disable the POSIX extension.
1396 : set useopcode=false in your hint file to disable the Opcode extension.
1399 ccflags_uselargefiles=''
1400 ldflags_uselargefiles=''
1401 libswanted_uselargefiles=''
1402 : set usemultiplicity on the Configure command line to enable multiplicity.
1403 : set usesocks on the Configure command line to enable socks.
1404 : List of libraries we want.
1405 : If anyone needs extra -lxxx, put those in a hint file.
1406 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1407 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1408 : We probably want to search /usr/shlib before most other libraries.
1409 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1410 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1411 glibpth="/usr/shlib $glibpth"
1412 : Do not use vfork unless overridden by a hint file.
1415 : Find the basic shell for Bourne shell scripts
1419 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1422 if test -f "$xxx"; then
1425 : Build up a list and do a single loop so we can 'break' out.
1426 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1427 for xxx in sh bash ksh pdksh ash; do
1429 try="$try ${p}/${xxx}"
1433 if test -f "$xxx"; then
1436 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1439 elif test -f "$xxx.exe"; then
1450 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1452 Usually it's in /bin/sh. How did you even get this far?
1453 Please contact me (Perl Maintainers) at perlbug@perl.org and
1454 we'll try to straighten this all out.
1460 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1461 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1464 : see if sh knows # comments
1465 if `$sh -c '#' >/dev/null 2>&1`; then
1469 test -f $xcat$_exe || xcat=/usr/bin/cat
1470 if test ! -f $xcat$_exe; then
1471 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1472 if test -f $p/cat$_exe; then
1477 if test ! -f $xcat$_exe; then
1478 echo "Can't find cat anywhere!"
1482 echo "#!$xcat" >sharp
1485 ./sharp > today 2>/dev/null
1486 if test -s today; then
1489 echo "#! $xcat" > sharp
1492 ./sharp > today 2>/dev/null
1493 if test -s today; then
1501 echo "Your $sh doesn't grok # comments--I will strip them later on."
1504 echo "exec grep -v '^[ ]*#'" >spitshell
1506 $eunicefix spitshell
1507 spitshell=`pwd`/spitshell
1509 echo "I presume that if # doesn't work, #! won't work either!"
1514 : figure out how to guarantee sh startup
1516 '') startsh=${sharpbang}${sh} ;;
1528 : echo "Yup, it does."
1530 echo "Hmm... '$startsh' does not guarantee sh startup..."
1531 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1535 : Save command line options in file UU/cmdline.opt for later use in
1536 : generating config.sh.
1537 cat > cmdline.opt <<EOSH
1538 : Configure command line arguments.
1547 cat >>cmdline.opt <<EOSH
1548 config_arg$argn='$arg'
1550 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1553 arg_exp=`cat cmdl.opt`
1554 args_exp="$args_exp$args_sep'$arg_exp'"
1555 argn=`expr $argn + 1`
1560 : produce awk script to parse command line options
1561 cat >options.awk <<'EOF'
1563 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1565 len = length(optstr);
1566 for (i = 1; i <= len; i++) {
1567 c = substr(optstr, i, 1);
1568 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1579 if (substr(str, 1, 1) != "-") {
1580 printf("'%s'\n", str);
1584 for (i = 2; i <= len; i++) {
1585 c = substr(str, i, 1);
1587 printf("-%s\n", substr(str, i));
1593 printf("'%s'\n", substr(str, i + 1));
1606 : process the command line options
1607 set X `for arg in "$@"; do echo "X$arg"; done |
1608 sed -e s/X// | awk -f options.awk`
1613 : set up default values
1623 rm -f optdef.sh posthint.sh
1624 cat >optdef.sh <<EOS
1630 while test $# -gt 0; do
1632 -d) shift; fastread=yes;;
1633 -e) shift; alldone=cont;;
1637 if test -r "$1"; then
1640 echo "$me: cannot read config file $1." >&2
1646 -h) shift; error=true;;
1647 -r) shift; reuseval=true;;
1648 -s) shift; silent=true; realsilent=true;;
1649 -E) shift; alldone=exit;;
1650 -K) shift; knowitall=true;;
1651 -O) shift; override=true;;
1652 -S) shift; silent=true; extractsh=true;;
1657 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1658 echo "$me: ignoring -D $1" >&2
1661 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1662 *) echo "$1='define'" >> optdef.sh;;
1669 *=) echo "$1" >> optdef.sh;;
1671 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1672 echo "$me: ignoring -U $1" >&2
1674 *) echo "$1='undef'" >> optdef.sh;;
1685 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1689 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1690 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1696 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1697 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1698 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1699 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1700 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1701 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1707 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1709 echo "$yyy=''" >> posthint.sh ;;
1714 echo "$yyy='$zzz'" >> posthint.sh ;;
1716 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1718 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1723 echo "$yyy=$zzz" >> posthint.sh ;;
1724 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1728 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1731 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1739 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1740 [-U symbol] [-U symbol=] [-A command:symbol...]
1741 -d : use defaults for all answers.
1742 -e : go on without questioning past the production of config.sh.
1743 -f : specify an alternate default configuration file.
1744 -h : print this help message and exit (with an error status).
1745 -r : reuse C symbols value if possible (skips costly nm extraction).
1746 -s : silent mode, only echoes questions and essential information.
1747 -D : define symbol to have some value:
1748 -D symbol symbol gets the value 'define'
1749 -D symbol=value symbol gets the value 'value'
1750 common used examples (see INSTALL for more info):
1751 -Duse64bitint use 64bit integers
1752 -Duse64bitall use 64bit integers and pointers
1753 -Dusethreads use thread support
1754 -Dinc_version_list=none do not include older perl trees in @INC
1755 -DEBUGGING=none DEBUGGING options
1756 -Dcc=gcc choose your compiler
1757 -Dprefix=/opt/perl5 choose your destination
1758 -E : stop at the end of questions, after having produced config.sh.
1759 -K : do not use unless you know what you are doing.
1760 -O : let -D and -U override definitions from loaded configuration file.
1761 -S : perform variable substitutions on all .SH files (can mix with -f)
1762 -U : undefine symbol:
1763 -U symbol symbol gets the value 'undef'
1764 -U symbol= symbol gets completely empty
1766 -A : manipulate symbol after the platform specific hints have been applied:
1767 -A append:symbol=value append value to symbol
1768 -A symbol=value like append:, but with a separating space
1769 -A define:symbol=value define symbol to have value
1770 -A clear:symbol define symbol to be ''
1771 -A define:symbol define symbol to be 'define'
1772 -A eval:symbol=value define symbol to be eval of value
1773 -A prepend:symbol=value prepend value to symbol
1774 -A undef:symbol define symbol to be 'undef'
1775 -A undef:symbol= define symbol to be ''
1776 e.g.: -A prepend:libswanted='cl pthread '
1777 -A ccflags=-DSOME_MACRO
1778 -V : print version number and exit (with a zero status).
1785 case "$fastread$alldone" in
1788 case "$extractsh" in
1791 if test ! -t 0; then
1792 echo "Say 'sh Configure', not 'sh <Configure'"
1802 true) exec 1>/dev/null;;
1805 : run the defines and the undefines, if any, but leave the file out there...
1808 : create the posthint manipulation script and leave the file out there...
1813 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1814 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1815 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1816 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1817 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1820 : Some greps do not return status, grrr.
1821 echo "grimblepritz" >grimble
1822 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1824 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1830 : the following should work in any shell
1834 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1835 cat >contains <<'EOSS'
1836 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1841 : Find the path to the source tree
1844 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1848 *) src=`cd ../$src && pwd` ;;
1861 if test -f $rsrc/Configure && \
1862 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1864 : found it, so we are ok.
1867 for src in . .. ../.. ../../.. ../../../..; do
1868 if test -f ../$src/Configure && \
1869 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1880 Sorry, I can't seem to locate the source dir for $package. Please start
1881 Configure with an explicit path -- i.e. /some/path/Configure.
1889 echo "Sources for $package found in \"$src\"." >&4
1893 : script used to extract .SH files with variable substitutions
1894 cat >extract <<'EOS'
1896 echo "Doing variable substitutions on .SH files..."
1897 if test -f MANIFEST; then
1898 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1900 echo "(Looking for .SH files under the source directory.)"
1901 set x `(cd "$src"; find . -name "*.SH" -print)`
1905 0) set x `(cd "$src"; echo *.SH)`; shift;;
1907 if test ! -f "$src/$1"; then
1913 while test $name; do
1914 if test ! -d "$name"; then
1915 create="$name $create";
1916 name=`echo $name | sed -e "s|^[^/]*$||"`;
1917 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1922 for file in $create; do
1931 dir=`expr X$file : 'X\(.*\)/'`
1932 file=`expr X$file : 'X.*/\(.*\)'`
1933 (cd "$dir" && . ./$file)
1943 dir=`expr X$file : 'X\(.*\)/'`
1944 file=`expr X$file : 'X.*/\(.*\)'`
1945 (set x $dir; shift; eval $mkdir_p)
1946 sh <"$src/$dir/$file"
1955 if test -f "$src/config_h.SH"; then
1956 if test ! -f config.h; then
1957 : oops, they left it out of MANIFEST, probably, so do it anyway.
1958 . "$src/config_h.SH"
1963 : extract files and exit if asked to do so
1964 case "$extractsh" in
1966 case "$realsilent" in
1970 case "$config_sh" in
1971 '') config_sh='config.sh';;
1974 echo "Fetching answers from $config_sh..."
1977 test "$override" && . ./optdef.sh
1981 echo "Extraction done."
1986 : Eunice requires " " instead of "", can you believe it
1989 echo "Beginning of configuration questions for $package."
1991 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1993 : first determine how to suppress newline on echo command
1995 echo "Checking echo to see how to suppress newlines..."
1996 (echo "hi there\c" ; echo " ") >.echotmp
1997 if $contains c .echotmp >/dev/null 2>&1 ; then
2008 echo $n "The star should be here-->$c"
2012 : Now test for existence of everything in MANIFEST
2014 if test -f "$rsrc/MANIFEST"; then
2015 echo "First let's make sure your kit is complete. Checking..." >&4
2016 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2017 (split -l 50 2>/dev/null || split -50)
2020 for filelist in x??; do
2021 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2022 >/dev/null 2>>"$tmppwd/missing")
2024 if test -s missing; then
2028 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2030 You have the option of continuing the configuration process, despite the
2031 distinct possibility that your kit is damaged, by typing 'y'es. If you
2032 do, don't blame me if something goes wrong. I advise you to type 'n'o
2033 and contact the author (perlbug@perl.org).
2036 echo $n "Continue? [n] $c" >&4
2040 echo "Continuing..." >&4
2044 echo "ABORTING..." >&4
2049 echo "Looks good..."
2052 echo "There is no MANIFEST file. I hope your kit is complete !"
2056 : Find the appropriate value for a newline for tr
2058 if test -n "$DJGPP"; then
2061 if test X"$trnl" = X; then
2062 case "`echo foo|tr '\n' x 2>/dev/null`" in
2066 if test X"$trnl" = X; then
2067 case "`echo foo|tr '\012' x 2>/dev/null`" in
2068 foox) trnl='\012' ;;
2071 if test X"$trnl" = X; then
2072 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2073 fooxy) trnl='\n\r' ;;
2076 if test X"$trnl" = X; then
2079 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2085 : compute the number of columns on the terminal for proper question formatting
2090 : set up the echo used in my read
2091 myecho="case \"\$xxxm\" in
2092 '') echo $n \"\$rp $c\" >&4;;
2094 '') echo $n \"[\$xxxm] $c\";;
2096 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2098 echo $n \"[\$xxxm] $c\" >&4
2100 echo $n \"\$rp [\$xxxm] $c\" >&4
2106 : now set up to do reads with possible shell escape and default assignment
2112 case "\$fastread" in
2113 yes) case "\$dflt" in
2116 case "\$silent-\$rp" in
2121 *) case "\$silent" in
2122 true) case "\$rp" in
2127 while expr "X\$ans" : "X!" >/dev/null; do
2131 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2139 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2148 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2153 echo "(OK, I'll run with -d after this question.)" >&4
2156 echo "*** Sorry, \$1 not supported yet." >&4
2166 echo "*** Substitution done -- please confirm."
2168 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2173 echo "*** Error -- try again."
2180 case "\$ans\$xxxm\$nostick" in
2192 : create .config dir to save info across Configure sessions
2193 test -d ../.config || mkdir ../.config
2194 cat >../.config/README <<EOF
2195 This directory created by Configure to save information that should
2196 persist across sessions for $package.
2198 You may safely delete it if you wish.
2201 : See if we are using a devel version and want that
2202 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2205 usedevel="$define" ;;
2206 *) case "$xversion" in
2209 *** WHOA THERE!!! ***
2211 This is an UNSTABLE DEVELOPMENT release.
2212 The version of this $package distribution is $xversion, that is, odd,
2213 (as opposed to even) and that signifies a development release.
2214 If you want a maintenance release, you want an even-numbered version.
2216 Do ***NOT*** install this into production use.
2217 Data corruption and crashes are possible.
2219 It is most seriously suggested that you do not continue any further
2220 unless you want to help in developing and debugging Perl.
2222 If you *still* want to build perl, you can answer 'y' now,
2223 or pass -Dusedevel to Configure.
2226 rp='Do you really want to continue?'
2230 [yY]) echo >&4 "Okay, continuing."
2231 usedevel="$define" ;;
2232 *) echo >&4 "Okay, bye."
2243 case "$versiononly" in
2244 '') versiononly="$define" ;;
2246 case "$installusrbinperl" in
2247 '') installusrbinperl="$undef" ;;
2252 : general instructions
2255 user=`(logname) 2>/dev/null`
2257 '') user=`whoami 2>&1`;;
2259 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2262 rp='Would you like to see the instructions?'
2273 This installation shell script will examine your system and ask you questions
2274 to determine how the perl5 package should be installed. If you get
2275 stuck on a question, you may use a ! shell escape to start a subshell or
2276 execute a command. Many of the questions will have default answers in square
2277 brackets; typing carriage return will give you the default.
2279 On some of the questions which ask for file or directory names you are allowed
2280 to use the ~name construct to specify the login directory belonging to "name",
2281 even if you don't have a shell which knows about that. Questions where this is
2282 allowed will be marked "(~name ok)".
2286 dflt='Type carriage return to continue'
2290 The prompter used in this script allows you to use shell variables and
2291 backticks in your answers. You may use $1, $2, etc... to refer to the words
2292 in the default answer, as if the default line was a set of arguments given to a
2293 script shell. This means you may also use $* to repeat the whole default line,
2294 so you do not have to re-type everything to add something to the default.
2296 Every time there is a substitution, you will have to confirm. If there is an
2297 error (e.g. an unmatched backtick), the default answer will remain unchanged
2298 and you will be prompted again.
2300 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2301 the questions and use the computed defaults (or the previous answers if there
2302 was already a config.sh file). Type 'Configure -h' for a list of options.
2303 You may also start interactively and then answer '& -d' at any prompt to turn
2304 on the non-interactive behaviour for the remainder of the execution.
2310 Much effort has been expended to ensure that this shell script will run on any
2311 Unix system. If despite that it blows up on yours, your best bet is to edit
2312 Configure and run it again. If you can't run Configure for some reason,
2313 you'll have to generate a config.sh file by hand. Whatever problems you
2314 have, let me (perlbug@perl.org) know how I blew it.
2316 This installation script affects things in two ways:
2318 1) it may do direct variable substitutions on some of the files included
2320 2) it builds a config.h file for inclusion in C programs. You may edit
2321 any of these files as the need arises after running this script.
2323 If you make a mistake on a question, there is no easy way to back up to it
2324 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2325 files. Configure will offer to let you do this before it runs the SH files.
2328 dflt='Type carriage return to continue'
2330 case "$firsttime" in
2331 true) echo $user >>../.config/instruct;;
2335 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2336 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2337 if test "X$sysroot" = X; then
2342 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2343 # _sysroot is used in places where we need --sysroot=foo
2344 # but using the rest of the flags could cause issues.
2345 _sysroot="--sysroot=$sysroot";
2349 ccflags="$ccflags $_sysroot"
2354 ldflags="$ldflags $_sysroot"
2359 cppflags="$cppflags $_sysroot"
2361 # lddlflags updated below in lddlflags section;
2362 # same with cccdlflags
2366 # Adjust some defaults to also use $sysroot
2367 for var in xlibpth loclibpth locincpth glibpth; do
2370 for path in $xxx; do
2371 eval $var=\"\$$var $sysroot$path\"
2377 : find out where common programs are
2379 echo "Locating common programs..." >&4
2392 if test -d \$dir/\$thing; then
2398 for thisthing in \$dir/\$thing; do
2399 : just loop through to pick last item
2401 if test -f \$thisthing; then
2404 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2407 elif test -f \$dir/\$thing.exe; then
2408 if test -n "$DJGPP"; then
2409 echo \$dir/\$thing.exe
2410 elif test "$eunicefix" != ":"; then
2411 : on Eunice apparently
2464 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2465 pth="$pth $sysroot/lib $sysroot/usr/lib"
2466 for file in $loclist; do
2470 if test -f "$xxx"; then
2473 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2474 xxx=`./loc $file $file $pth`
2477 '') xxx=`./loc $file $file $pth`;;
2478 *) xxx=`./loc $xxx $xxx $pth`;;
2480 eval $file=$xxx$_exe
2484 echo $file is in $xxx.
2487 echo $file is in $xxx.
2490 echo "I don't know where '$file' is, and my life depends on it." >&4
2491 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2497 echo "Don't worry if any of the following aren't found..."
2499 for file in $trylist; do
2503 if test -f "$xxx"; then
2506 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2507 xxx=`./loc $file $file $pth`
2510 '') xxx=`./loc $file $file $pth`;;
2511 *) xxx=`./loc $xxx $xxx $pth`;;
2513 eval $file=$xxx$_exe
2517 echo $file is in $xxx.
2520 echo $file is in $xxx.
2523 echo "I don't see $file out there, $say."
2530 echo "Substituting grep for egrep."
2537 *) if $less -R </dev/null >/dev/null 2>&1; then
2538 echo "Substituting less -R for less."
2546 echo "Substituting cp for ln."
2555 echo "I can't find make or gmake, and my life depends on it." >&4
2556 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2564 *) # We can't have osname yet.
2565 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2566 # Assume that gmake, if found, is definitely GNU make
2567 # and prefer it over the system make.
2568 echo "Substituting gmake for make."
2576 echo "Hopefully test is built into your sh."
2579 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2580 echo "Using the test built into your sh."
2588 echo "Hopefully echo is built into your sh."
2593 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2594 $echo $n "hi there$c" >foo1
2595 echo $n "hi there$c" >foo2
2596 if cmp foo1 foo2 >/dev/null 2>&1; then
2597 echo "They are compatible. In fact, they may be identical."
2604 They are not compatible! You are probably running ksh on a non-USG system.
2605 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2606 have echo built in and we may have to run some Bourne shell scripts. That
2607 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2610 $echo $n "The star should be here-->$c"
2617 # This question was auctioned at YAPC::Europe-2007 in Vienna
2618 # I never promised you could answer it. I only auctioned the question.
2620 The following message is sponsored by
2622 Dresden.pm<--The stars should be here.
2624 Dear Perl user, system administrator or package
2625 maintainer, the Perl community sends greetings to
2626 you. Do you (emblematical) greet back [Y/n]? n
2630 : Check what type of C compiler we use
2634 cat <<'EOSC' >>trygcc
2639 int main(int argc, char *argv[]) {
2643 if $cc -o try $ccflags $ldflags try.c; then
2646 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2652 # Skip this test because it gives a false match on output like:
2653 # ./trygcc: line 23: cc: command not found
2654 # case "`$cc -v -c try.c 2>&1`" in
2655 # *gcc*) trygcc=no ;;
2657 if $test X"$trygcc" = Xyes; then
2658 if gcc -o try -c try.c; then
2660 echo "You seem to have a working gcc, though." >&4
2661 # Switching compilers may undo the work of hints files.
2662 # The most common problem is -D_REENTRANT for threads.
2663 # This heuristic catches that case, but gets false positives
2664 # if -Dusethreads was not actually specified. Better to
2665 # bail out here with a useful message than fail
2666 # mysteriously later. Should we perhaps just try to
2667 # re-invoke Configure -Dcc=gcc config_args ?
2668 if $test -f usethreads.cbu; then
2671 *** However, any setting of the C compiler flags (e.g. for thread support)
2672 *** will be lost. It may be necessary for you to restart Configure and
2673 *** add -Dcc=gcc to your Configure command line.
2676 rp="Would you like to go ahead and try gcc anyway?"
2679 rp="Would you like to use it?"
2682 if $test -f myread; then
2685 if $test -f UU/myread; then
2688 echo "Cannot find myread, sorry. Aborting." >&2
2693 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2706 cat <<'EOSC' >>checkcc
2711 int main(int argc, char *argv[]) {
2715 if $cc -o try $ccflags $ldflags try.c; then
2718 if $test X"$despair" = Xyes; then
2719 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2722 You need to find a working C compiler.
2723 Either (purchase and) install the C compiler supplied by your OS vendor,
2724 or for a free C compiler try http://gcc.gnu.org/
2725 I cannot continue any further, aborting.
2734 : determine whether symbolic links are supported
2737 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2738 echo "Symbolic links are supported." >&4
2741 echo "Symbolic links are NOT supported." >&4
2746 : determine whether symbolic links are supported
2750 echo "Checking how to test for symbolic links..." >&4
2752 if $test "X$issymlink" = X; then
2754 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2755 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2757 if test $? = 0; then
2760 echo "Your builtin 'test -h' may be broken." >&4
2763 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2766 if test -f "$p/$test"; then
2775 echo "Trying external '$test -h'." >&4
2776 issymlink="$test -h"
2777 if $test ! -h sym >/dev/null 2>&1; then
2778 echo "External '$test -h' is broken, too." >&4
2786 if $test "X$issymlink" = X; then
2787 if $test -L sym 2>/dev/null; then
2788 issymlink="$test -L"
2789 echo "The builtin '$test -L' worked." >&4
2792 if $test "X$issymlink" != X; then
2793 echo "You can test for symbolic links with '$issymlink'." >&4
2795 echo "I do not know how you can test for symbolic links." >&4
2799 *) echo "No symbolic links, so not testing for their testing..." >&4
2804 : Make symlinks util
2805 case "$mksymlinks" in
2808 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2811 *) case "$lns:$issymlink" in
2812 *"ln"*" -s:"*"test -"?)
2813 echo "Creating the symbolic links..." >&4
2814 echo "(First creating the subdirectories...)" >&4
2816 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2818 test -z "$directory" && break
2822 if test ! -d t/base; then
2823 echo "Failed to create the subdirectories. Aborting." >&4
2826 echo "(Then creating the symlinks...)" >&4
2827 awk '{print $1}' $src/MANIFEST | while true; do
2829 test -z "$filename" && break
2830 if test -f $filename; then
2831 if $issymlink $filename; then
2835 if test -f $filename; then
2836 echo "$filename already exists, not symlinking."
2838 ln -s $src/$filename $filename
2842 if test ! -f t/base/lex.t; then
2843 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2848 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2856 : Check for Cross-Compilation
2857 if $test "X$targethost" = "X"; then
2860 if $test "X$targetenv" = "X"; then
2863 case "$usecrosscompile" in
2865 $echo "Cross-compiling..."
2868 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2869 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2870 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2871 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2872 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2873 # leave out ld, choosing it is more complex
2874 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2875 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2876 # We are in a weird spot. Just before us, some values
2877 # were 'saved', to be restored after the hints are
2878 # run. This means that the changes we made to ar,
2879 # nm and ranlib will get reverted.
2880 # To avoid that, we hijack the saving mechanism and
2881 # have it save our new values.
2882 for file in ar nm ranlib; do
2884 eval $file=$xxx$_exe
2889 case "$targetarch" in
2890 '') echo "Targetarch not defined." >&4; croak=y ;;
2891 *) echo "Using targetarch $targetarch." >&4 ;;
2893 case "$targethost" in
2894 '') echo "Targethost not defined." >&4; croak=y ;;
2895 *) echo "Using targethost $targethost." >&4
2900 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2902 : compile a host miniperl and generate_uudmap, unless we got passed them
2903 if $test "X$hostperl" = X; then
2904 echo "Building host miniperl and generate_uudmap binaries" >&4
2912 $src/Configure -des -Dusedevel -Dmksymlinks
2914 case "$hostgenerate" in
2915 '') $make generate_uudmap
2916 hostgenerate=$src/host/generate_uudmap
2918 "$undef") hostgenerate=''
2921 hostperl=$src/host/miniperl
2924 hostosname=`$hostperl -le 'print $^O'`
2927 usecrosscompile="$undef"
2931 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2932 case "$targethost" in
2933 '') echo "Checking for cross-compile" >&4
2934 case "$usecrosscompile$multiarch" in
2935 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2936 if [ -f Makefile ]; then
2938 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2940 echo "Configure done."
2944 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2951 *) echo "Using targethost $targethost." >&4
2953 /*) run=$src/Cross/run
2954 targetmkdir=$src/Cross/mkdir
2956 from=$src/Cross/from
2958 *) pwd=`$test -f ../Configure & cd ..; pwd`
2960 targetmkdir=$pwd/Cross/mkdir
2962 from=$pwd/Cross/from
2965 case "$targetrun" in
2966 '') targetrun=ssh ;;
2971 case "$targetfrom" in
2972 '') targetfrom=scp ;;
2976 from=$from-$targetfrom
2977 case "$targetdir" in
2979 echo "Guessing targetdir $targetdir." >&4
2982 case "$targetuser" in
2984 echo "Guessing targetuser $targetuser." >&4
2987 case "$targetport" in
2989 echo "Guessing targetport $targetport." >&4
2992 case "$targetfrom" in
2996 case "$targetrun" in
3016 '') cwd=$targetdir ;;
3021 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3027 *) echo "Unknown targetrun '$targetrun'" >&4
3031 case "$targetmkdir" in
3033 cat >$targetmkdir <<EOF
3035 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3037 $chmod a+rx $targetmkdir
3039 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3051 $targetmkdir \`dirname \$f\`
3052 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3055 $targetmkdir $targetdir/\`dirname \$f\`
3056 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3069 $mkdir -p $targetdir/\`dirname \$f\`
3070 $cp \$f $targetdir/\$f || exit 1
3073 $targetmkdir $targetdir/\`dirname \$f\`
3074 $cp \$f $targetdir/\$f || exit 1
3081 *) echo "Unknown targetto '$targetto'" >&4
3085 case "$targetfrom" in
3092 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3097 cp) cat >$from <<EOF
3102 cp $targetdir/\$f . || exit 1
3107 *) echo "Unknown targetfrom '$targetfrom'" >&4
3111 if $test ! -f $run; then
3112 echo "Target 'run' script '$run' not found." >&4
3116 if $test ! -f $to; then
3117 echo "Target 'to' script '$to' not found." >&4
3121 if $test ! -f $from; then
3122 echo "Target 'from' script '$from' not found." >&4
3126 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3130 Using '$run' for remote execution,
3131 and '$from' and '$to'
3132 for remote file transfer.
3138 usecrosscompile="$undef"
3143 : see whether [:lower:] and [:upper:] are supported character classes
3145 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3147 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3151 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3152 # (0xd9 and 0xe2), therefore that is a nice testing point.
3153 if test "X$up" = X -o "X$low" = X; then
3154 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3160 if test "X$up" = X -o "X$low" = X; then
3161 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3167 if test "X$up" = X -o "X$low" = X; then
3168 case "`echo RS | od -x 2>/dev/null`" in
3170 echo "Hey, this might be EBCDIC." >&4
3171 if test "X$up" = X -o "X$low" = X; then
3172 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3173 rs) up='[A-IJ-RS-Z]'
3178 if test "X$up" = X -o "X$low" = X; then
3179 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3189 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3191 echo "Using $up and $low to convert case." >&4
3194 echo "I don't know how to translate letters from upper to lower case." >&4
3195 echo "Your tr is not acting any way I know of." >&4
3199 : set up the translation script tr, must be called with ./tr of course
3203 '[A-Z][a-z]') exec $tr '$up' '$low';;
3204 '[a-z][A-Z]') exec $tr '$low' '$up';;
3211 : Try to determine whether config.sh was made on this system
3212 case "$config_sh" in
3214 myuname=`$uname -a 2>/dev/null`
3215 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3216 # Downcase everything to avoid ambiguity.
3217 # Remove slashes and single quotes so we can use parts of this in
3218 # directory and file names.
3219 # Remove newlines so myuname is sane to use elsewhere.
3220 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3221 # because the A-Z/a-z are not consecutive.
3222 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3223 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3224 newmyuname="$myuname"
3226 case "$knowitall" in
3228 if test -f ../config.sh; then
3229 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3230 eval "`grep myuname= ../config.sh`"
3232 if test "X$myuname" = "X$newmyuname"; then
3240 : Get old answers from old config file if Configure was run on the
3241 : same system, otherwise use the hints.
3244 if test -f config.sh; then
3246 rp="I see a config.sh file. Shall I use it to set the defaults?"
3249 n*|N*) echo "OK, I'll ignore it."
3250 mv config.sh config.sh.old
3251 myuname="$newmyuname"
3253 *) echo "Fetching default answers from your old config.sh file..." >&4
3261 : Older versions did not always set $sh. Catch re-use of such
3271 if test ! -f config.sh; then
3274 First time through, eh? I have some defaults handy for some systems
3275 that need some extra help getting the Configure answers right:
3278 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3280 : Half the following guesses are probably wrong... If you have better
3281 : tests or hints, please send them to perlbug@perl.org
3282 : The metaconfig authors would also appreciate a copy...
3283 $test -f /irix && osname=irix
3284 $test -f /xenix && osname=sco_xenix
3285 $test -f /dynix && osname=dynix
3286 $test -f /dnix && osname=dnix
3287 $test -f /lynx.os && osname=lynxos
3288 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3289 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3290 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3291 $test -f /bin/mips && /bin/mips && osname=mips
3292 $test -d /usr/apollo/bin && osname=apollo
3293 $test -f /etc/saf/_sactab && osname=svr4
3294 $test -d /usr/include/minix && osname=minix
3295 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3296 if $test -d /MachTen -o -d /MachTen_Folder; then
3298 if $test -x /sbin/version; then
3299 osvers=`/sbin/version | $awk '{print $2}' |
3300 $sed -e 's/[A-Za-z]$//'`
3301 elif $test -x /usr/etc/version; then
3302 osvers=`/usr/etc/version | $awk '{print $2}' |
3303 $sed -e 's/[A-Za-z]$//'`
3309 $test -f /sys/posix.dll &&
3310 $test -f /usr/bin/what &&
3311 set X `/usr/bin/what /sys/posix.dll` &&
3312 $test "$3" = UWIN &&
3316 if $test -f $uname; then
3324 umips) osname=umips ;;
3327 [23]100) osname=mips ;;
3329 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3330 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3333 elif $test -f /etc/kconfig; then
3335 if test "$lns" = "$ln -s"; then
3337 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3339 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3346 if test -n "$DJGPP"; then
3355 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3357 # oslevel can fail with:
3358 # oslevel: Unable to acquire lock.
3359 *not\ found) osvers="$4"."$3" ;;
3360 '<3240'|'<>3240') osvers=3.2.0 ;;
3361 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3362 '=3250'|'>3250') osvers=3.2.5 ;;
3366 bitrig) osname=bitrig
3369 bsd386) osname=bsd386
3372 cygwin*) osname=cygwin
3375 *dc.osx) osname=dcosx
3381 domainos) osname=apollo
3387 dragonfly) osname=dragonfly
3390 dynixptx*) osname=dynixptx
3391 osvers=`echo "$4"|sed 's/^v//'`
3393 freebsd) osname=freebsd
3395 genix) osname=genix ;;
3399 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3412 $test -f /system/lib/libandroid.so && osname=linux-android
3416 netbsd*) osname=netbsd
3419 news-os) osvers="$3"
3421 4*) osname=newsos4 ;;
3425 nonstop-ux) osname=nonstopux ;;
3426 openbsd) osname=openbsd
3432 POSIX-BC | posix-bc ) osname=posix-bc
3435 powerux | power_ux | powermax_os | powermaxos | \
3436 powerunix | power_unix) osname=powerux
3442 solaris) osname=solaris
3444 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3451 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3455 titanos) osname=titanos
3464 ultrix) osname=ultrix
3467 osf1|mls+) case "$5" in
3470 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3473 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3476 hp*) osname=hp_osf1 ;;
3477 mips) osname=mips_osf1 ;;
3480 # UnixWare 7.1.2 is known as Open UNIX 8
3481 openunix|unixware) osname=svr5
3489 $2) case "$osname" in
3493 : svr4.x or possibly later
3503 if test -f /stand/boot ; then
3504 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3505 if test -n "$INITPROG" -a -f "$INITPROG"; then
3506 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3507 if test -n "$isesix"; then
3515 *) if test -f /etc/systemid; then
3517 set `echo $3 | $sed 's/\./ /g'` $4
3518 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3520 elif $test -f $src/hints/sco_$1_$2.sh; then
3522 elif $test -f $src/hints/sco_$1.sh; then
3527 '') : Still unknown. Probably a generic Sys V.
3536 *) case "$osname" in
3537 '') : Still unknown. Probably a generic BSD.
3545 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3546 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3547 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3550 $rm -f UU/kernel.what
3551 elif test -d c:/. -o -n "$is_os2" ; then
3558 case "$targetarch" in
3561 case "$targetarch" in
3563 # Will load qnx.sh, which should change osname to nto
3568 # Catch arm-linux-androideabi, mipsel-linux-android,
3569 # and i686-linux-android
3570 osname=linux-android
3574 # Something like arm-linux-gnueabihf is really just
3581 # XXX perhaps we should just assume
3582 # osvers to be 2, or maybe take the value
3583 # from targetarch. Using $run before the
3584 # hints are run is somewhat icky.
3585 set X `$run $uname -a 2>/dev/null`
3588 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3593 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3600 : Now look for a hint file osname_osvers, unless one has been
3601 : specified already.
3604 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3605 : Also try without trailing minor version numbers.
3606 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3607 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3608 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3609 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3612 *) case "$osvers" in
3615 *) if $test -f $src/hints/$file.sh ; then
3617 elif $test -f $src/hints/$xfile.sh ; then
3619 elif $test -f $src/hints/$xxfile.sh ; then
3621 elif $test -f $src/hints/$xxxfile.sh ; then
3623 elif $test -f $src/hints/$xxxxfile.sh ; then
3625 elif $test -f "$src/hints/${osname}.sh" ; then
3634 if $test -f Policy.sh ; then
3637 none) dflt="Policy" ;;
3638 *) dflt="Policy $dflt" ;;
3643 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3647 if $test -f Policy.sh ; then
3650 There's also a Policy hint file available, which should make the
3651 site-specific (policy) questions easier to answer.
3658 You may give one or more space-separated answers, or "none" if appropriate.
3659 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3660 previous run of Configure, you may specify it as well as or instead of
3661 OS-specific hints. If hints are provided for your OS, you should use them:
3662 although Perl can probably be built without hints on many platforms, using
3663 hints often improve performance and may enable features that Configure can't
3664 set up on its own. If there are no hints that match your OS, specify "none";
3665 DO NOT give a wrong version or a wrong OS.
3669 rp="Which of these apply, if any?"
3672 for file in $tans; do
3673 if $test X$file = XPolicy -a -f Policy.sh; then
3675 $cat Policy.sh >> UU/config.sh
3676 elif $test -f $src/hints/$file.sh; then
3677 . $src/hints/$file.sh
3678 $cat $src/hints/$file.sh >> UU/config.sh
3679 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3682 : Give one chance to correct a possible typo.
3683 echo "$file.sh does not exist"
3685 rp="hint to use instead?"
3687 for file in $ans; do
3688 if $test -f "$src/hints/$file.sh"; then
3689 . $src/hints/$file.sh
3690 $cat $src/hints/$file.sh >> UU/config.sh
3691 elif $test X$ans = X -o X$ans = Xnone ; then
3694 echo "$file.sh does not exist -- ignored."
3701 : Remember our hint file for later.
3702 if $test -f "$src/hints/$file.sh" ; then
3712 echo "Fetching default answers from $config_sh..." >&4
3716 cp $config_sh config.sh 2>/dev/null
3726 test "$override" && . ./optdef.sh
3728 : Restore computed paths
3729 for file in $loclist $trylist; do
3730 eval $file="\$_$file"
3735 Configure uses the operating system name and version to set some defaults.
3736 The default value is probably right if the name rings a bell. Otherwise,
3737 since spelling matters for me, either accept the default or answer "none"
3744 ''|' '|none) dflt=none ;;
3745 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3748 *) dflt="$osname" ;;
3750 rp="Operating system name?"
3754 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3760 ''|' '|none) dflt=none ;;
3761 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3762 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3764 ''|' ') dflt=none ;;
3769 *) dflt="$osvers" ;;
3771 rp="Operating system version?"
3781 : who configured the system
3782 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3785 cf_by=`(logname) 2>/dev/null`
3788 cf_by=`(whoami) 2>/dev/null`
3790 "") cf_by=unknown ;;
3795 : decide how portable to be. Allow command line overrides.
3796 case "$d_portable" in
3798 *) d_portable="$define" ;;
3801 : set up shell script to do ~ expansion
3807 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3810 if $test -f /bin/csh; then
3811 /bin/csh -f -c "glob \$1"
3816 name=\`$expr x\$1 : '..\([^/]*\)'\`
3817 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3818 if $test ! -d "\$dir"; then
3820 echo "\$me: can't locate home directory for: \$name" >&2
3825 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3841 : now set up to get a file name
3845 cat <<'EOSC' >>getfile
3861 : getfile will accept an answer from the comma-separated list
3862 : enclosed in parentheses even if it does not meet other criteria.
3863 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3864 fn=`echo $fn | sed 's/(.*)//'`
3870 loc_file=`expr $fn : '.*:\(.*\)'`
3871 fn=`expr $fn : '\(.*\):.*'`
3879 */*) fullpath=true;;
3888 *e*) exp_file=true;;
3891 *p*) nopath_ok=true;;
3896 *d*) type='Directory';;
3897 *l*) type='Locate';;
3902 Locate) what='File';;
3907 case "$d_portable" in
3915 while test "$type"; do
3920 true) rp="$rp (~name ok)";;
3923 if test -f UU/getfile.ok && \
3924 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3943 value=`UU/filexp $ans`
3946 if test "$ans" != "$value"; then
3947 echo "(That expands to $value on this system.)"
3961 /*) value="$ansexp" ;;
3962 [a-zA-Z]:/*) value="$ansexp" ;;
3967 echo "I shall only accept a full path name, as in /bin/ls." >&4
3968 echo "Use a ! shell escape if you wish to check pathnames." >&4
3971 echo "Please give a full path name, starting with slash." >&4
3974 echo "Note that using ~name is ok provided it expands well." >&4
3987 for fp in $gfpth; do
3988 if test "X$fp" = X.; then
3993 if test -f "$pf"; then
3995 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3997 echo "($value is not a plain file, but that's ok.)"
4000 if test X"$type" = X; then
4007 for fp in $gfpth; do
4008 if test "X$fp" = X.; then
4013 direxp="$fp/$ansexp"
4015 if test -d "$direxp"; then
4023 if test -d "$ansexp"; then
4024 echo "(Looking for $loc_file in directory $value.)"
4025 value="$value/$loc_file"
4026 ansexp="$ansexp/$loc_file"
4028 if test -f "$ansexp"; then
4031 case "$nopath_ok" in
4032 true) case "$value" in
4034 *) echo "Assuming $value will be in people's path."
4050 if test "$fastread" = yes; then
4055 rp="$what $value doesn't exist. Use that name anyway?"
4074 test "X$gfpthkeep" != Xy && gfpth=""
4077 : determine root of directory hierarchy where package will be installed.
4080 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4083 dflt=`echo "$prefix" | sed 's/.$//'`
4091 By default, $package will be installed in $dflt/bin, manual pages
4092 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4093 installation directories. Typically this is something like /usr/local.
4094 If you wish to have binaries under /usr/bin but other parts of the
4095 installation under /usr/local, that's ok: you will be prompted
4096 separately for each of the installation directories, the prefix being
4097 only used to set the defaults.
4101 rp='Installation prefix to use?'
4109 *) oldprefix="$prefix";;
4116 : allow them to override the AFS root
4119 *) afsroot=$afsroot ;;
4125 $define|true) afs=true ;;
4126 $undef|false) afs=false ;;
4127 *) if $test -d $afsroot; then
4135 echo "AFS may be running... I'll be extra cautious then..." >&4
4137 echo "AFS does not seem to be running..." >&4
4140 : determine installation prefix for where package is to be installed.
4144 Since you are running AFS, I need to distinguish the directory in which
4145 files will reside from the directory in which they are installed (and from
4146 which they are presumably copied to the former directory by occult means).
4149 case "$installprefix" in
4150 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4151 *) dflt="$installprefix";;
4156 In some special cases, particularly when building $package for distribution,
4157 it is convenient to distinguish the directory in which files should be
4158 installed from the directory ($prefix) in which they will
4159 eventually reside. For most users, these two directories are the same.
4162 case "$installprefix" in
4164 *) dflt=$installprefix;;
4168 rp='What installation prefix should I use for installing files?'
4170 installprefix="$ans"
4171 installprefixexp="$ansexp"
4173 : Perform the prefixexp/installprefixexp correction if necessary
4174 cat <<EOS >installprefix
4177 cat <<'EOSC' >>installprefix
4178 : Change installation prefix, if necessary.
4179 if $test X"$prefix" != X"$installprefix"; then
4180 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4182 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4185 chmod +x installprefix
4186 $eunicefix installprefix
4188 : Set variables such as privlib and privlibexp from the output of ./getfile
4189 : performing the prefixexp/installprefixexp correction if necessary.
4190 cat <<EOS >setprefixvar
4193 cat <<'EOSC' >>setprefixvar
4194 eval "${prefixvar}=\"\$ans\""
4195 eval "${prefixvar}exp=\"\$ansexp\""
4198 chmod +x setprefixvar
4199 $eunicefix setprefixvar
4201 : set up the script used to warn in case of inconsistency
4210 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4212 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4213 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4218 echo "*** WHOA THERE!!! ***" >&4
4219 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4222 rp=" Keep the $hint value?"
4225 y) td=$was; tu=$was;;
4229 : function used to set '$1' to '$val'
4230 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4232 $define$undef) . ./whoa; eval "$var=\$td";;
4233 $undef$define) . ./whoa; eval "$var=\$tu";;
4234 *) eval "$var=$val";;
4237 : get the patchlevel
4239 echo "Getting the current patchlevel..." >&4
4240 if $test -r $rsrc/patchlevel.h;then
4241 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4242 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4243 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4244 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4245 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4246 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4247 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4256 $echo "(You do not have patchlevel.h. Eek.)"
4258 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4259 version_patchlevel_string="version $patchlevel subversion $subversion"
4260 case "$perl_patchlevel" in
4262 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4263 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4267 $echo "(You have $package $version_patchlevel_string.)"
4271 : XXX Should be a Configure test for double-dots in filenames.
4272 version=`echo $revision $patchlevel $subversion | \
4273 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4274 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4275 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4278 version=`echo $revision $patchlevel $subversion | \
4279 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4280 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4281 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4284 : Special case the 5.005_xx maintenance series, which used 5.005
4285 : without any subversion label as a subdirectory in $sitelib
4286 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4287 api_versionstring='5.005'
4290 : Do we want threads support and if so, what type
4291 case "$usethreads" in
4292 $define|true|[yY]*) dflt='y';;
4293 *) # Catch case where user specified ithreads or 5005threads but
4294 # forgot -Dusethreads (A.D. 4/2002)
4295 case "$useithreads$use5005threads" in
4296 *$define*) dflt='y';;
4303 Perl can be built to offer a form of threading support on some systems
4304 To do so, Configure can be run with -Dusethreads.
4306 Note that Perl built with threading support runs slightly slower
4307 and uses slightly more memory than plain Perl.
4309 If this doesn't make any sense to you, just accept the default '$dflt'.
4311 rp='Build a threading Perl?'
4314 y|Y) val="$define" ;;
4320 if $test $patchlevel -lt 9; then
4321 case "$usethreads" in
4323 : Default to ithreads unless overridden on command line or with
4326 case "$use5005threads" in
4328 echo "5.005 threads are no longer supported"
4332 case "$useithreads" in
4333 $undef|false|[nN]*) dflt='n';;
4335 rp='Use the newer interpreter-based ithreads?'
4338 y|Y) val="$define" ;;
4343 : Now set use5005threads to the opposite value.
4344 case "$useithreads" in
4345 $define) val="$undef" ;;
4352 useithreads="$undef"
4353 use5005threads="$undef"
4357 case "$useithreads$use5005threads" in
4361 You cannot have both the ithreads and the 5.005 threads enabled
4362 at the same time. Disabling the 5.005 threads since they are
4363 much less stable than the ithreads.
4366 use5005threads="$undef"
4371 : perl-5.9.x and later
4373 if test X"$usethreads" = "X$define"; then
4374 case "$use5005threads" in
4378 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4385 use5005threads="$undef"
4386 useithreads="$usethreads"
4389 case "$d_oldpthreads" in
4390 '') : Configure tests would be welcome here. For now, assume undef.
4392 *) val="$d_oldpthreads" ;;
4398 : Look for a hint-file generated 'call-back-unit'. If the
4399 : user has specified that a threading perl is to be built,
4400 : we may need to set or change some other defaults.
4401 if $test -f usethreads.cbu; then
4402 echo "Your platform has some specific hints regarding threaded builds, using them..."
4405 case "$usethreads" in
4406 "$define"|true|[yY]*)
4408 (Your platform does not have any specific hints for threaded builds.
4409 Assuming POSIX threads, then.)
4415 : Check if multiplicity is required
4418 Perl can be built so that multiple Perl interpreters can coexist
4419 within the same Perl executable.
4422 case "$useithreads" in
4425 This multiple interpreter support is required for interpreter-based threads.
4429 *) case "$usemultiplicity" in
4430 $define|true|[yY]*) dflt='y';;
4434 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4435 rp='Build Perl for multiplicity?'
4438 y|Y) val="$define" ;;
4446 : Check if morebits is requested
4447 case "$usemorebits" in
4448 "$define"|true|[yY]*)
4449 use64bitint="$define"
4450 uselongdouble="$define"
4451 usemorebits="$define"
4453 *) usemorebits="$undef"
4457 : Determine the C compiler to be used
4463 rp="Use which C compiler?"
4467 : See whether they have no cc but they do have gcc
4469 if $test -f cc.cbu; then
4474 : make some quick guesses about what we are up against
4476 $echo $n "Hmm... $c"
4486 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4487 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4489 echo "Looks kind of like an OSF/1 system, but we'll see..."
4491 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4492 xxx=`./loc addbib blurfl $pth`
4493 if $test -f $xxx; then
4494 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4498 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4499 echo "Looks kind of like an extended USG system, but we'll see..."
4501 echo "Looks kind of like a USG system, but we'll see..."
4505 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4506 echo "Looks kind of like a BSD system, but we'll see..."
4510 echo "Looks kind of like a Version 7 system, but we'll see..."
4513 case "$eunicefix" in
4516 There is, however, a strange, musty smell in the air that reminds me of
4517 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4521 : it so happens the Eunice I know will not run shell scripts in Unix format
4525 echo "Congratulations. You aren't running Eunice."
4529 : Detect OS2. The p_ variable is set above in the Head.U unit.
4530 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4531 : semicolon as a patch separator
4536 I have the feeling something is not exactly right, however...don't tell me...
4537 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4538 (Or you may be running DOS with DJGPP.)
4543 if test -f /xenix; then
4544 echo "Actually, this looks more like a XENIX system..."
4549 echo "It's not Xenix..."
4554 if test -f /venix; then
4555 echo "Actually, this looks more like a VENIX system..."
4562 echo "Nor is it Venix..."
4565 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4566 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4569 : Check if we are using GNU gcc and what its version is
4571 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4575 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4577 printf("%s\n", __VERSION__);
4579 printf("%s\n", "1");
4585 if $cc -o try $ccflags $ldflags try.c; then
4586 gccversion=`$run ./try`
4587 case "$gccversion" in
4588 '') echo "You are not using GNU cc." ;;
4589 *) echo "You are using GNU cc $gccversion."
4595 echo "*** WHOA THERE!!! ***" >&4
4596 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4597 case "$knowitall" in
4599 echo " You'd better start hunting for one and let me know about it." >&4
4605 case "$gccversion" in
4606 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4608 case "$gccversion" in
4609 '') gccosandvers='' ;;
4610 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4611 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4613 case "$gccosandvers" in
4614 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4615 $osname$osvers) ;; # looking good
4616 $osname*) cat <<EOM >&4
4618 *** WHOA THERE!!! ***
4620 Your gcc has not been compiled for the exact release of
4621 your operating system ($gccosandvers versus $osname$osvers).
4623 In general it is a good idea to keep gcc synchronized with
4624 the operating system because otherwise serious problems
4625 may ensue when trying to compile software, like Perl.
4627 I'm trying to be optimistic here, though, and will continue.
4628 If later during the configuration and build icky compilation
4629 problems appear (headerfile conflicts being the most common
4630 manifestation), I suggest reinstalling the gcc to match
4631 your operating system release.
4635 *) gccosandvers='' ;; # failed to parse, better be silent
4643 # gcc 3.* complain about adding -Idirectories that they already know about,
4644 # so we will take those off from locincpth.
4645 case "$gccversion" in
4647 echo "main(){}">try.c
4648 for incdir in $locincpth; do
4649 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4650 grep '^c[cp]p*[01]: warning: changing search order '`
4651 if test "X$warn" != X; then
4652 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4658 # gcc 4.9 by default does some optimizations that break perl.
4659 # see ticket 121505.
4661 # The -fwrapv disables those optimizations (and probably others,) so
4662 # for gcc 4.9 (and later, since the optimizations probably won't go
4663 # away), add -fwrapv unless the user requests -fno-wrapv, which
4664 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4665 # which turns the overflows -fwrapv ignores into runtime errors.
4666 case "$gccversion" in
4667 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4669 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4670 *) ccflags="$ccflags -fwrapv" ;;
4674 : What should the include directory be ?
4675 : Use sysroot if set, so findhdr looks in the right place.
4677 $echo $n "Hmm... $c"
4678 dflt="$sysroot/usr/include"
4681 if $test -f /bin/mips && /bin/mips; then
4682 echo "Looks like a MIPS system..."
4683 $cat >usr.c <<'EOCP'
4684 #ifdef SYSTYPE_BSD43
4688 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4689 dflt='/bsd43/usr/include'
4693 mips_type='System V'
4695 $rm -f usr.c usr.out
4696 echo "and you're compiling with the $mips_type compiler and libraries."
4700 echo "Doesn't look like a MIPS system."
4710 case "$xxx_prompt" in
4713 rp='Where are the include files you want to use?'
4721 : see how we invoke the C preprocessor
4723 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4724 cat <<'EOT' >testcpp.c
4730 if test ! -f cppstdin; then
4731 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4732 # AIX cc -E doesn't show the absolute headerfile
4733 # locations but we'll cheat by using the -M flag.
4734 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
4736 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4739 echo "Keeping your $hint cppstdin wrapper."
4742 wrapper=`pwd`/cppstdin
4746 if $test "X$cppstdin" != "X" && \
4747 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4748 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4750 echo "You used to use $cppstdin $cppminus so we'll use that again."
4752 '') echo "But let's see if we can live without a wrapper..." ;;
4754 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4755 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4757 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4760 echo "(However, $cpprun $cpplast does not work, let's see...)"
4768 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4775 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4776 $cc -E <testcpp.c >testcpp.out 2>&1; \
4777 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4778 echo "Yup, it does."
4779 x_cpp="$cc $cppflags -E"
4781 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4782 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4783 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4784 echo "Yup, it does."
4785 x_cpp="$cc $cppflags -E"
4787 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4788 $cc -P <testcpp.c >testcpp.out 2>&1; \
4789 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4790 echo "Yipee, that works!"
4791 x_cpp="$cc $cppflags -P"
4793 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4794 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4795 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4796 echo "At long last!"
4797 x_cpp="$cc $cppflags -P"
4799 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4800 $cpp <testcpp.c >testcpp.out 2>&1; \
4801 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4803 x_cpp="$cpp $cppflags"
4805 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4806 $cpp - <testcpp.c >testcpp.out 2>&1; \
4807 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4808 echo "Hooray, it works! I was beginning to wonder."
4809 x_cpp="$cpp $cppflags"
4811 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4812 $wrapper <testcpp.c >testcpp.out 2>&1; \
4813 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4819 rp="No dice. I can't find a C preprocessor. Name one:"
4823 $x_cpp <testcpp.c >testcpp.out 2>&1
4824 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4825 echo "OK, that will do." >&4
4827 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4842 echo "Perhaps can we force $cc -E using a wrapper..."
4843 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4844 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4850 echo "Nope, we'll have to live without it..."
4864 "$wrapper"|'cppstdin') ;;
4865 *) $rm -f $wrapper;;
4867 $rm -f testcpp.c testcpp.out
4869 : Adjust cppfilter for path component separator
4871 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4872 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4876 : Use gcc to determine libpth and incpth
4877 # If using gcc or clang, we can get better values for libpth, incpth
4878 # and usrinc directly from the compiler.
4879 # Note that ccname for clang is also gcc.
4882 $echo 'extern int foo;' > try.c
4883 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4885 if $test $# -gt 0; then
4887 incpth="`$echo $incpth|$sed 's/^ //'`"
4889 j="`$echo $i|$sed 's,/include$,/lib,'`"
4890 if $test -d $j; then
4894 libpth="`$echo $libpth|$sed 's/^ //'`"
4895 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4896 if $test -d $xxx; then
4899 *) libpth="$libpth $xxx";;
4906 '') for i in $incpth; do
4907 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4915 case "$usecrosscompile" in
4918 '') echo "Incpth not defined." >&4; croak=y ;;
4919 *) echo "Using incpth '$incpth'." >&4 ;;
4922 '') echo "Libpth not defined." >&4; croak=y ;;
4923 *) echo "Using libpth '$libpth'." >&4 ;;
4926 '') echo "Usrinc not defined." >&4; croak=y ;;
4927 *) echo "Using usrinc $usrinc." >&4 ;;
4931 if test "X$sysroot" = X; then
4932 echo "Cannot continue, aborting." >&4; exit 1
4934 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4943 : Default value for incpth is just usrinc
4945 '') incpth="$usrinc";;
4948 : Set private lib path
4951 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4956 '') dlist="$loclibpth $plibpth $glibpth";;
4957 *) dlist="$libpth";;
4960 : Now check and see which directories actually exist, avoiding duplicates
4963 if $test -d $xxx; then
4966 *) libpth="$libpth $xxx";;
4972 Some systems have incompatible or broken versions of libraries. Among
4973 the directories listed in the question below, please remove any you
4974 know not to be holding relevant libraries, and add any that are needed.
4975 Say "none" for none.
4979 if test "X$sysroot" != X; then
4981 You have set sysroot to $sysroot, please supply the directories excluding sysroot
4994 rp="Directories to use for library searches?"
5001 : compute shared library extension
5004 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5014 On some systems, shared libraries may be available. Answer 'none' if
5015 you want to suppress searching of shared libraries for the remainder
5016 of this configuration.
5019 rp='What is the file extension used for shared libraries?'
5023 : Does target system insist that shared library basenames are unique
5026 Some dynamic loaders assume that the *basename* of shared library filenames
5027 are globally unique. We'll default this to undef as we assume your system
5028 is not this weird. Set to defined if you're on one of them.
5033 rp='Make shared library basenames unique?'
5036 y|Y) val="$define" ;;
5039 set d_libname_unique
5042 : Define several unixisms.
5043 : Hints files or command line option can be used to override them.
5044 : The convoluted testing is in case hints files set either the old
5047 '') case "$exe_ext" in
5049 *) _exe="$exe_ext" ;;
5054 '') case "$lib_ext" in
5061 '') case "$obj_ext" in
5068 '') case "$path_sep" in
5079 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5081 : Which makefile gets called first. This is used by make depend.
5082 case "$firstmakefile" in
5083 '') firstmakefile='makefile';;
5086 : Check is we will use socks
5088 $define|true|[yY]*) dflt='y';;
5093 Perl can be built to use the SOCKS proxy protocol library. To do so,
5094 Configure must be run with -Dusesocks. If you use SOCKS you also need
5095 to use the PerlIO abstraction layer, this will be implicitly selected.
5097 If this doesn't make any sense to you, just accept the default '$dflt'.
5099 rp='Build Perl for SOCKS?'
5102 y|Y) val="$define" ;;
5108 : Check for uselongdouble support
5110 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5113 case "$uselongdouble" in
5114 $define|true|[yY]*) dflt='y';;
5119 Perl can be built to take advantage of long doubles which
5120 (if available) may give more accuracy and range for floating point numbers.
5122 If this doesn't make any sense to you, just accept the default '$dflt'.
5124 rp='Try to use long doubles if available?'
5127 y|Y) val="$define" ;;
5133 case "$uselongdouble" in
5134 true|[yY]*) uselongdouble="$define" ;;
5137 : Look for a hint-file generated 'call-back-unit'. If the
5138 : user has specified that long doubles should be used,
5139 : we may need to set or change some other defaults.
5140 if $test -f uselongdouble.cbu; then
5141 echo "Your platform has some specific hints regarding long doubles, using them..."
5142 . ./uselongdouble.cbu
5144 case "$uselongdouble" in
5147 (Your platform does not have any specific hints for long doubles.)
5153 : Looking for optional libraries
5155 echo "Checking for optional libraries..." >&4
5160 case "$libswanted" in
5161 '') libswanted='c_s';;
5164 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5166 case "$usecbacktrace" in
5167 "$define") libswanted="$libswanted bfd" ;;
5173 for thisdir in $libpth $xlibpth; do
5174 test -d $thisdir && libspath="$libspath $thisdir"
5176 for thislib in $libswanted; do
5177 for thisdir in $libspath; do
5179 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5180 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5181 $test -f "$xxx" && eval $libscheck
5182 $test -f "$xxx" && libstyle=shared
5183 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5184 $test -f "$xxx" && eval $libscheck
5185 $test -f "$xxx" && libstyle=shared
5187 if test ! -f "$xxx"; then
5188 xxx=$thisdir/lib$thislib.$so
5189 $test -f "$xxx" && eval $libscheck
5190 $test -f "$xxx" && libstyle=shared
5192 if test ! -f "$xxx"; then
5193 xxx=$thisdir/lib$thislib$_a
5194 $test -f "$xxx" && eval $libscheck
5195 $test -f "$xxx" && libstyle=static
5197 if test ! -f "$xxx"; then
5198 xxx=$thisdir/$thislib$_a
5199 $test -f "$xxx" && eval $libscheck
5200 $test -f "$xxx" && libstyle=static
5202 if test ! -f "$xxx"; then
5203 xxx=$thisdir/lib${thislib}_s$_a
5204 $test -f "$xxx" && eval $libscheck
5205 $test -f "$xxx" && libstyle=static
5206 $test -f "$xxx" && thislib=${thislib}_s
5208 if test ! -f "$xxx"; then
5209 xxx=$thisdir/Slib$thislib$_a
5210 $test -f "$xxx" && eval $libscheck
5211 $test -f "$xxx" && libstyle=static
5213 if $test -f "$xxx"; then
5215 shared) echo "Found -l$thislib (shared)." ;;
5216 static) echo "Found -l$thislib." ;;
5217 *) echo "Found -l$thislib ($libstyle)." ;;
5221 *) dflt="$dflt -l$thislib"
5222 libsfound="$libsfound $xxx"
5224 libsfiles="$libsfiles $yyy"
5225 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5226 case " $libsdirs " in
5228 *) libsdirs="$libsdirs $yyy" ;;
5235 if $test ! -f "$xxx"; then
5236 echo "No -l$thislib."
5247 ' '|'') dflt='none';;
5252 In order to compile $package on your machine, a number of libraries
5253 are usually needed. Include any other special libraries here as well.
5254 Say "none" for none. The default list is almost always right.
5258 rp="What libraries to use?"
5265 : determine optimization, if desired, or use for debug flag also
5267 ' '|$undef) dflt='none';;
5269 *) dflt="$optimize";;
5273 By default, $package compiles with the -O flag to use the optimizer.
5274 Alternately, you might want to use the symbolic debugger, which uses
5275 the -g flag (on traditional Unix systems). Either flag can be
5276 specified here. To use neither flag, specify the word "none".
5279 rp="What optimizer/debugger flag should be used?"
5283 'none') optimize=" ";;
5286 : Check what DEBUGGING is required from the command line
5287 : -DEBUGGING or -DDEBUGGING or
5288 : -DEBUGGING=both = -g + -DDEBUGGING
5289 : -DEBUGGING=-g or -Doptimize=-g = -g
5290 : -DEBUGGING=none or -UDEBUGGING =
5291 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5294 *) DEBUGGING=$EBUGGING ;;
5297 case "$DEBUGGING" in
5301 *) optimize="$optimize -g" ;;
5305 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5313 case "$DEBUGGING" in
5314 both|$define) dflt='-DDEBUGGING'
5317 : argument order is deliberate, as the flag will start with - which set could
5318 : think is an option
5319 checkccflag='check=$1; flag=$2; callback=$3;
5321 echo "Checking if your compiler accepts $flag" 2>&1;
5322 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5323 echo "int main(void) { return 0; }" > gcctest.c;
5324 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5325 echo "Yes, it does." 2>&1;
5326 if $test -s gcctest.out ; then
5327 echo "But your platform does not like it:";
5332 echo "Leaving current flags $ccflags alone." 2>&1
5334 *) dflt="$dflt $flag";
5340 echo "Nope, it does not, but that is ok." 2>&1;
5344 : We will not override a previous value, but we might want to
5345 : augment a hint file
5347 default|recommended)
5348 case "$gccversion" in
5349 1*) dflt="$dflt -fpcc-struct-return" ;;
5351 case "$optimize:$DEBUGGING" in
5352 *-g*:old) dflt="$dflt -DDEBUGGING";;
5354 case "$gccversion" in
5355 2*) if $test -d /etc/conf/kconfig.d &&
5356 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5358 # Interactive Systems (ISC) POSIX mode.
5363 case "$gccversion" in
5366 ?*) set strict-aliasing -fno-strict-aliasing
5370 # For gcc, adding -pipe speeds up compilations for some, but apparently
5371 # some assemblers can't read from stdin. (It also slows down compilations
5372 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5373 case "$gccversion" in
5379 # on x86_64 (at least) we require an extra library (libssp) in the
5380 # link command line. This library is not named, so I infer that it is
5381 # an implementation detail that may change. Hence the safest approach
5382 # is to add the flag to the flags passed to the compiler at link time,
5383 # as that way the compiler can do the right implementation dependant
5385 case "$gccversion" in
5386 ?*) set stack-protector -fstack-protector
5393 case "$mips_type" in
5394 *BSD*|'') inclwanted="$locincpth $usrinc";;
5395 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5397 for thisincl in $inclwanted; do
5398 if $test -d $thisincl; then
5399 if $test x$thisincl != x$usrinc; then
5401 *" -I$thisincl "*);;
5402 *) dflt="$dflt -I$thisincl ";;
5408 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5410 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5418 *) dflt="$dflt -D$2";;
5422 set signal.h LANGUAGE_C; eval $inctest
5426 ccflags="$ccflags -DSOCKS"
5431 default|recommended) dflt="$ccflags $dflt" ;;
5432 *) dflt="$ccflags";;
5441 Your C compiler may want other flags. For this question you should include
5442 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5443 but you should NOT include libraries or ld flags like -lwhatever. If you
5444 want $package to honor its debug switch, you should include -DDEBUGGING here.
5445 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5447 To use no flags, specify the word "none".
5453 rp="Any additional cc flags?"
5460 : the following weeds options from ccflags that are of no interest to cpp
5462 '') cppflags="$ccflags" ;;
5463 *) cppflags="$cppflags $ccflags" ;;
5465 case "$gccversion" in
5466 1*) cppflags="$cppflags -D__GNUC__"
5468 case "$mips_type" in
5470 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5476 echo "Let me guess what the preprocessor flags are..." >&4
5490 *) ftry="$previous $flag";;
5492 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5493 >cpp1.out 2>/dev/null && \
5494 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5495 >cpp2.out 2>/dev/null && \
5496 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5497 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5499 cppflags="$cppflags $ftry"
5509 *-*) echo "They appear to be: $cppflags";;
5511 $rm -f cpp.c cpp?.out
5515 : flags used in final linking phase
5517 '') if ./venix; then
5523 *-posix*) dflt="$dflt -posix" ;;
5526 *) dflt="$ldflags";;
5528 # See note above about -fstack-protector
5530 *-fstack-protector*)
5532 *-fstack-protector*) ;; # Don't add it again
5533 *) dflt="$dflt -fstack-protector" ;;
5538 : Try to guess additional flags to pick up local libraries.
5539 for thislibdir in $libpth; do
5540 case " $loclibpth " in
5543 *"-L$thislibdir "*) ;;
5544 *) dflt="$dflt -L$thislibdir" ;;
5556 Your C linker may need flags. For this question you should
5557 include -L/whatever and any other flags used by the C linker, but you
5558 should NOT include libraries like -lwhatever.
5560 Make sure you include the appropriate -L/path flags if your C linker
5561 does not normally search all of the directories you specified above,
5564 To use no flags, specify the word "none".
5568 rp="Any additional ld flags (NOT including libraries)?"
5574 rmlist="$rmlist pdp11"
5578 echo "Checking your choice of C compiler and flags for coherency..." >&4
5579 $cat > try.c <<'EOF'
5581 int main() { printf("Ok\n"); return(0); }
5583 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5585 $cat >try.msg <<'EOM'
5586 I've tried to compile and run the following simple program:
5589 $cat try.c >> try.msg
5591 $cat >> try.msg <<EOM
5598 and I got the following output:
5602 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5603 if $sh -c "$run ./try " >>try.msg 2>&1; then
5607 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5610 echo "The program compiled OK, but exited with status $?." >>try.msg
5611 rp="You have a problem. Shall I abort Configure"
5615 echo "I can't compile the test program." >>try.msg
5616 rp="You have a BIG problem. Shall I abort Configure"
5622 case "$knowitall" in
5624 echo "(The supplied flags or libraries might be incorrect.)"
5632 *) echo "Ok. Stopping Configure." >&4
5637 n) echo "OK, that should do.";;
5639 $rm_try gcctest gcctest.out
5641 : define a shorthand compile call
5645 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5646 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5650 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5651 : define a shorthand compile call for compilations that should be ok.
5655 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5657 : determine filename position in cpp output
5659 echo "Computing filename position in cpp output for #include directives..." >&4
5661 vos) testaccess=-e ;;
5664 echo '#include <stdio.h>' > foo.c
5667 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5668 $grep '^[ ]*#.*stdio\.h' | \
5669 while read cline; do
5672 while $test \$# -gt 0; do
5673 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5678 pos=\`expr \$pos + 1\`
5690 *) pos="${fieldn}th";;
5692 echo "Your cpp writes the filename in the $pos field of the line."
5694 : locate header file
5699 for usrincdir in $incpth
5701 if test -f \$usrincdir/\$wanted; then
5702 echo "\$usrincdir/\$wanted"
5706 awkprg='{ print \$$fieldn }'
5707 echo "#include <\$wanted>" > foo\$\$.c
5708 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5709 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5710 while read cline; do
5711 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5713 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5714 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5719 # status = 0: grep returned 0 lines, case statement not executed
5720 # status = 1: headerfile found
5721 # status = 2: while loop executed, no headerfile found
5725 if test \$status -eq 1; then
5732 : define an alternate in-header-list? function
5733 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5734 cont=true; xxf="echo \"<\$1> found.\" >&4";
5735 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5736 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5738 case $# in 4) instead=instead;; *) instead="at last";; esac;
5739 while $test "$cont"; do
5741 var=$2; eval "was=\$$2";
5742 if $test "$xxx" && $test -r "$xxx";
5744 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5747 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5748 set $yyy; shift; shift; yyy=$@;
5749 case $# in 0) cont="";;
5750 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5751 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5752 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5753 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5757 do set $yyy; var=$2; eval "was=\$$2";
5758 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5759 set $yyy; shift; shift; yyy=$@;
5762 : see if stdint is available
5763 set stdint.h i_stdint
5766 : see if stdlib is available
5767 set stdlib.h i_stdlib
5770 : check for lengths of integral types
5774 echo "Checking to see how big your integers are..." >&4
5783 printf("intsize=%d;\n", (int)sizeof(int));
5784 printf("longsize=%d;\n", (int)sizeof(long));
5785 printf("shortsize=%d;\n", (int)sizeof(short));
5790 if eval $compile_ok && $run ./try > /dev/null; then
5792 echo "Your integers are $intsize bytes long."
5793 echo "Your long integers are $longsize bytes long."
5794 echo "Your short integers are $shortsize bytes long."
5798 Help! I can't compile and run the intsize test program: please enlighten me!
5799 (This is probably a misconfiguration in your system or libraries, and
5800 you really ought to fix it. Still, I'll try anyway.)
5804 rp="What is the size of an integer (in bytes)?"
5808 rp="What is the size of a long integer (in bytes)?"
5812 rp="What is the size of a short integer (in bytes)?"
5820 : check for long long
5822 echo "Checking to see if you have long long..." >&4
5823 echo 'int main() { long long x = 7; return 0; }' > try.c
5825 if eval $compile; then
5827 echo "You have long long."
5830 echo "You do not have long long."
5836 : check for length of long long
5837 case "${d_longlong}${longlongsize}" in
5840 echo "Checking to see how big your long longs are..." >&4
5841 $cat >try.c <<'EOCP'
5845 printf("%d\n", (int)sizeof(long long));
5850 if eval $compile_ok; then
5851 longlongsize=`$run ./try`
5852 echo "Your long longs are $longlongsize bytes long."
5856 echo "(I can't seem to compile the test program. Guessing...)"
5857 rp="What is the size of a long long (in bytes)?"
5861 if $test "X$longsize" = "X$longlongsize"; then
5862 echo "(That isn't any different from an ordinary long.)"
5868 : see if inttypes.h is available
5869 : we want a real compile instead of Inhdr because some systems
5870 : have an inttypes.h which includes non-existent headers
5873 #include <inttypes.h>
5875 static int32_t foo32 = 0x12345678;
5879 if eval $compile; then
5880 echo "<inttypes.h> found." >&4
5883 echo "<inttypes.h> NOT found." >&4
5892 echo "Checking to see if you have int64_t..." >&4
5894 #include <sys/types.h>
5895 #$i_inttypes I_INTTYPES
5897 #include <inttypes.h>
5899 int main() { int64_t x = 7; }
5902 if eval $compile; then
5904 echo "You have int64_t."
5907 echo "You do not have int64_t."
5913 : Check if 64bit ints have a quad type
5915 echo "Checking which 64-bit integer type we could use..." >&4
5921 val='"unsigned int"'
5926 *) case "$longsize" in
5930 val='"unsigned long"'
5935 *) case "$d_longlong:$longlongsize" in
5940 val='"unsigned long long"'
5945 *) case "$d_int64_t" in
5964 '') echo "Alas, no 64-bit integer types in sight." >&4
5967 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5972 : Do we want 64bit support
5973 case "$uselonglong" in
5974 "$define"|true|[yY]*)
5977 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5979 use64bitint="$define"
5982 case "$use64bits" in
5983 "$define"|true|[yY]*)
5986 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5988 use64bitint="$define"
5991 case "$use64bitints" in
5992 "$define"|true|[yY]*)
5995 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5997 use64bitint="$define"
6000 case "$use64bitsint" in
6001 "$define"|true|[yY]*)
6004 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6006 use64bitint="$define"
6009 case "$uselonglongs" in
6010 "$define"|true|[yY]*)
6013 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6015 use64bitint="$define"
6018 case "$use64bitsall" in
6019 "$define"|true|[yY]*)
6022 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6024 use64bitall="$define"
6029 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6031 case "$use64bitall" in
6032 "$define"|true|[yY]*) use64bitint="$define" ;;
6038 You have natively 64-bit long integers.
6042 *) case "$use64bitint" in
6043 "$define"|true|[yY]*) dflt='y';;
6052 Perl can be built to take advantage of 64-bit integer types
6053 on some systems. To do so, Configure can be run with -Duse64bitint.
6054 Choosing this option will most probably introduce binary incompatibilities.
6056 If this doesn't make any sense to you, just accept the default '$dflt'.
6057 (The default has been chosen based on your configuration.)
6059 rp='Try to use 64-bit integers, if available?'
6062 [yY]*) val="$define" ;;
6070 case "$use64bitall" in
6071 "$define"|true|[yY]*) dflt='y' ;;
6072 *) case "$longsize" in
6080 You may also choose to try maximal 64-bitness. It means using as much
6081 64-bitness as possible on the platform. This in turn means even more
6082 binary incompatibilities. On the other hand, your platform may not
6083 have any more 64-bitness available than what you already have chosen.
6085 If this doesn't make any sense to you, just accept the default '$dflt'.
6086 (The default has been chosen based on your configuration.)
6088 rp='Try to use maximal 64-bit support, if available?'
6091 [yY]*) val="$define" ;;
6096 case "$use64bitall" in
6098 case "$use64bitint" in
6102 Since you have chosen a maximally 64-bit build, I'm also turning on
6103 the use of 64-bit integers.
6105 use64bitint="$define" ;;
6110 : Look for a hint-file generated 'call-back-unit'. If the
6111 : user has specified that a 64-bit perl is to be built,
6112 : we may need to set or change some other defaults.
6113 if $test -f use64bitint.cbu; then
6114 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6117 case "$use64bitint" in
6118 "$define"|true|[yY]*)
6119 : This test was common to all the OpenBSD forks, and seems harmless for
6122 echo "Checking if your C library has broken 64-bit functions..." >&4
6125 typedef $uquadtype myULL;
6132 {4294967303.15, 4294967303ULL},
6133 {4294967294.2, 4294967294ULL},
6134 {4294967295.7, 4294967295ULL},
6137 for (p = test; p->u; p++) {
6138 myULL x = (myULL)p->d;
6149 if eval $compile_ok; then
6150 libcquad=`$run ./try`
6151 echo "Your C library's 64-bit functions are $libcquad."
6153 echo "(I can't seem to compile the test program.)"
6154 echo "Assuming that your C library's 64-bit functions are ok."
6163 *** You have a C library with broken 64-bit functions.
6164 *** 64-bit support does not work reliably in this configuration.
6165 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6166 *** Cannot continue, aborting.
6173 4) case "$archname64" in
6174 '') archname64=64int ;;
6181 : Look for a hint-file generated 'call-back-unit'. If the
6182 : user has specified that a maximally 64-bit perl is to be built,
6183 : we may need to set or change some other defaults.
6184 if $test -f use64bitall.cbu; then
6185 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6188 case "$use64bitall" in
6189 "$define"|true|[yY]*)
6191 4) case "$archname64" in
6192 ''|64int) archname64=64all ;;
6199 case "$d_quad:$use64bitint" in
6203 *** You have chosen to use 64-bit integers,
6204 *** but none can be found.
6205 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6206 *** Cannot continue, aborting.
6213 : Check if we are using the GNU C library
6215 echo "Checking for GNU C Library..." >&4
6217 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6218 alone are insufficient to distinguish different versions, such as
6219 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6220 libc version 2.1.0. A. Dougherty, June 3, 2002.
6226 # ifdef __GLIBC_MINOR__
6227 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6228 # include <gnu/libc-version.h>
6229 printf("%s\n", gnu_get_libc_version());
6231 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6234 printf("%d\n", __GLIBC__);
6243 if eval $compile_ok && $run ./try > glibc.ver; then
6245 gnulibc_version=`$cat glibc.ver`
6246 echo "You are using the GNU C Library version $gnulibc_version"
6250 echo "You are not using the GNU C Library"
6256 : see if nm is to be used to determine whether a symbol is defined or not
6260 case "$d_gnulibc" in
6263 echo "nm probably won't work on the GNU C Library." >&4
6269 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6271 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6272 echo "'nm' won't be sufficient on this system." >&4
6278 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6279 if $test $dflt -gt 20; then
6289 true|$define) dflt=y;;
6296 I can use $nm to extract the symbols from your C libraries. This
6297 is a time consuming task which may generate huge output on the disk (up
6298 to 3 megabytes) but that should make the symbols extraction faster. The
6299 alternative is to skip the 'nm' extraction part and to compile a small
6300 test program instead to determine whether each symbol is present. If
6301 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6302 this may be the best solution.
6304 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6307 rp="Shall I use $nm to extract C symbols from the libraries?"
6310 [Nn]*) usenm=false;;
6319 : nm options which may be necessary
6321 '') if $test -f /mach_boot; then
6323 elif $test -d /usr/ccs/lib; then
6324 nm_opt='-p' # Solaris (and SunOS?)
6325 elif $test -f /dgux; then
6327 elif $test -f /lib64/rld; then
6328 nm_opt='-p' # 64-bit Irix
6334 : nm options which may be necessary for shared libraries but illegal
6335 : for archive libraries. Thank you, Linux.
6336 case "$nm_so_opt" in
6337 '') case "$myuname" in
6339 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6340 nm_so_opt='--dynamic'
6347 : Figure out where the libc is located
6350 : get list of predefined functions in a handy place
6355 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6361 *) for thislib in $libs; do
6364 : Handle C library specially below.
6367 thislib=`echo $thislib | $sed -e 's/^-l//'`
6368 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6370 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6372 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6374 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6376 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6378 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6380 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6385 libnames="$libnames $try"
6387 *) libnames="$libnames $thislib" ;;
6396 for xxx in $libpth; do
6397 $test -r $1 || set $xxx/libc.$so
6398 : The messy sed command sorts on library version numbers.
6400 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6401 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6403 s/[0-9][0-9]*/0000&/g
6404 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6407 $sort | $sed -e 's/^.* //'`
6410 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6411 $test -r $1 || set $sysroot/lib/libsys_s$_a
6417 if $test -r "$1"; then
6418 echo "Your (shared) C library seems to be in $1."
6420 elif $test -r /lib/libc && $test -r /lib/clib; then
6421 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6423 libc='/lib/clib /lib/libc'
6424 if $test -r /lib/syslib; then
6425 echo "(Your math library is in /lib/syslib.)"
6426 libc="$libc /lib/syslib"
6428 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6429 echo "Your C library seems to be in $libc, as you said before."
6430 elif $test -r $incpath/usr/lib/libc$_a; then
6431 libc=$incpath/usr/lib/libc$_a;
6432 echo "Your C library seems to be in $libc. That's fine."
6433 elif $test -r /lib/libc$_a; then
6435 echo "Your C library seems to be in $libc. You're normal."
6437 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6439 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6440 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6441 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6443 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6445 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6448 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6450 if $test -r "$tans"; then
6451 echo "Your C library seems to be in $tans, of all places."
6457 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6461 If the guess above is wrong (which it might be if you're using a strange
6462 compiler, or your machine supports multiple models), you can override it here.
6467 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6469 I can't seem to find your C library. I've looked in the following places:
6472 $sed 's/^/ /' libpath
6475 None of these seems to contain your C library. I need to get its name...
6480 rp='Where is your C library?'
6485 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6486 set X `cat libnames`
6489 case $# in 1) xxx=file; esac
6490 echo "Extracting names from the following $xxx for later perusal:" >&4
6492 $sed 's/^/ /' libnames >&4
6494 $echo $n "This may take a while...$c" >&4
6498 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6499 *) $nm $nm_opt $file 2>/dev/null;;
6504 $grep fprintf libc.tmp > libc.ptf
6505 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6506 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6508 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6510 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6512 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6514 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6516 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6518 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6520 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6522 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6524 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6526 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6528 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6530 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6532 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6533 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6535 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6537 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6539 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6541 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6543 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6545 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6547 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6549 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6551 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6553 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6555 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6557 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6559 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6561 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6563 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6566 $nm -p $* 2>/dev/null >libc.tmp
6567 $grep fprintf libc.tmp > libc.ptf
6568 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6569 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6575 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6577 if $ar t $libc > libc.tmp && \
6578 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6580 for thisname in $libnames $libc; do
6581 $ar t $thisname >>libc.tmp
6583 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6585 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6586 for thisname in $libnames $libc; do
6587 $ar tv $thisname >>libc.tmp
6588 emximp -o tmp.imp $thisname \
6590 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6591 < tmp.imp >>libc.tmp
6594 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6597 echo "$ar didn't seem to work right." >&4
6598 echo "Maybe this is a Cray...trying bld instead..." >&4
6600 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6603 for thisname in $libnames; do
6605 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6606 $ar t $thisname >>libc.tmp
6610 echo "That didn't work either. Giving up." >&4
6620 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6621 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6623 *) if $test -f /lib/syscalls.exp; then
6625 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6626 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6627 /lib/syscalls.exp >>libc.list
6633 $rm -f libnames libpath
6635 : Check if we are using C++
6637 echo "Checking for C++..." >&4
6638 $cat >try.c <<'EOCP'
6650 if eval $compile_ok && $run ./try; then
6652 echo "You are using a C++ compiler."
6655 echo "You are not using a C++ compiler."
6661 : is a C symbol defined?
6664 -v) tf=libc.tmp; tdc="";;
6665 -a) tf=libc.tmp; tdc="[]";;
6666 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6668 case "$d_cplusplus" in
6669 $define) extern_C="extern \"C\"" ;;
6670 *) extern_C="extern" ;;
6673 case "$reuseval-$4" in
6675 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6680 if $test "$runnm" = true; then
6681 if $contains $tlook $tf >/dev/null 2>&1; then
6683 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6684 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
6685 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6686 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6690 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
6691 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6697 $define) tval=true;;
6704 : define an is-in-libc? function
6705 inlibc='echo " "; td=$define; tu=$undef;
6706 sym=$1; var=$2; eval "was=\$$2";
6708 case "$reuseval$was" in
6718 echo "$sym() found." >&4;
6719 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6721 echo "$sym() NOT found." >&4;
6722 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6726 $define) echo "$sym() found." >&4;;
6727 *) echo "$sym() NOT found." >&4;;
6731 : check for length of double
6733 case "$doublesize" in
6735 echo "Checking to see how big your double precision numbers are..." >&4
6744 printf("%d\n", (int)sizeof(double));
6749 if eval $compile_ok; then
6750 doublesize=`$run ./try`
6751 echo "Your double is $doublesize bytes long."
6754 echo "(I can't seem to compile the test program. Guessing...)"
6755 rp="What is the size of a double precision number (in bytes)?"
6763 : see if this is a fenv.h system
6767 : see if this is a float.h system
6771 : check for long doubles
6773 echo "Checking to see if you have long double..." >&4
6774 echo 'int main() { long double x = 7.0; }' > try.c
6776 if eval $compile; then
6778 echo "You have long double."
6781 echo "You do not have long double."
6787 : see if ldexpl exists
6791 : check for length of long double
6792 case "${d_longdbl}${longdblsize}" in
6795 echo "Checking to see how big your long doubles are..." >&4
6796 $cat >try.c <<'EOCP'
6800 printf("%d\n", sizeof(long double));
6805 if eval $compile; then
6806 longdblsize=`$run ./try`
6807 echo "Your long doubles are $longdblsize bytes long."
6811 echo "(I can't seem to compile the test program. Guessing...)" >&4
6812 rp="What is the size of a long double (in bytes)?"
6816 if $test "X$doublesize" = "X$longdblsize"; then
6817 echo "That isn't any different from an ordinary double."
6818 echo "I'll keep your setting anyway, but you may see some"
6819 echo "harmless compilation warnings."
6825 $echo "Checking the kind of long doubles you have..." >&4
6826 case "$d_longdbl" in
6831 #define LONGDBLSIZE $longdblsize
6839 static const long double d = -0.1L;
6841 unsigned const char* b = (unsigned const char*)(&d);
6842 #if LDBL_MANT_DIG == 113 && LONGDBLSIZE == 16
6843 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6844 /* IEEE 754 128-bit little-endian */
6848 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6849 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6854 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6855 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
6856 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6857 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6858 * Also known as "extended precision". */
6862 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
6863 /* is there ever big-endian 80-bit, really? */
6868 #if LDBL_MANT_DIG == 106 && LONGDBLSIZE == 16
6869 /* software "double double", the 106 is 53+53 */
6870 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6871 /* double double 128-bit little-endian,
6872 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6876 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6877 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
6878 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6883 printf("-1\n"); /* unknown */
6888 if eval $compile; then
6889 longdblkind=`$run ./try`
6896 case "$longdblkind" in
6897 0) echo "Your long doubles are doubles." >&4 ;;
6898 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
6899 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
6900 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
6901 *) echo "Cannot figure out your long double." >&4 ;;
6906 : determine the architecture name
6908 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6909 tarch=`arch`"-$osname"
6910 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6911 if uname -m > tmparch 2>&1 ; then
6912 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6913 -e 's/$/'"-$osname/" tmparch`
6921 case "$myarchname" in
6924 echo "(Your architecture name used to be $myarchname.)"
6928 case "$targetarch" in
6930 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6935 *) dflt="$archname";;
6937 rp='What is your architecture name'
6941 : optionally add API version to the architecture for versioned archlibs
6942 case "$useversionedarchname" in
6943 $define|true|[yY]*) dflt='y';;
6946 rp='Add the Perl API version to your archname?'
6949 y|Y) useversionedarchname="$define" ;;
6950 *) useversionedarchname="$undef" ;;
6952 case "$useversionedarchname" in
6955 *-$api_versionstring)
6956 echo "...and architecture name already has -$api_versionstring" >&4
6959 archname="$archname-$api_versionstring"
6960 echo "...setting architecture name to $archname." >&4
6966 case "$usethreads" in
6968 echo "Threads selected." >&4
6970 *-thread*) echo "...and architecture name already has -thread." >&4
6972 *) archname="$archname-thread"
6973 echo "...setting architecture name to $archname." >&4
6978 case "$usemultiplicity" in
6980 echo "Multiplicity selected." >&4
6982 *-multi*) echo "...and architecture name already has -multi." >&4
6984 *) archname="$archname-multi"
6985 echo "...setting architecture name to $archname." >&4
6990 case "$use64bitint$use64bitall" in
6992 case "$archname64" in
6994 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6997 case "$use64bitint" in
6998 "$define") echo "64 bit integers selected." >&4 ;;
7000 case "$use64bitall" in
7001 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7004 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7006 *) archname="$archname-$archname64"
7007 echo "...setting architecture name to $archname." >&4
7013 case "$uselongdouble" in
7015 echo "Long doubles selected." >&4
7016 case "$longdblsize" in
7018 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7022 *-ld*) echo "...and architecture name already has -ld." >&4
7024 *) archname="$archname-ld"
7025 echo "...setting architecture name to $archname." >&4
7032 if $test -f archname.cbu; then
7033 echo "Your platform has some specific hints for architecture name, using them..."
7037 : set the prefixit variable, to compute a suitable default value
7038 prefixit='case "$3" in
7040 case "$oldprefix" in
7041 "") eval "$1=\"\$$2\"";;
7048 ""|" ") eval "$1=\"\$$2\"";;
7054 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7056 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7057 /*-$oldprefix/*|\~*-$oldprefix/*)
7058 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7059 *) eval "$1=\"\$$2\"";;
7063 : determine installation style
7064 : For now, try to deduce it from prefix unless it is already set.
7065 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7066 case "$installstyle" in
7067 '') case "$prefix" in
7068 *perl*) dflt='lib';;
7069 *) dflt='lib/perl5' ;;
7072 *) dflt="$installstyle" ;;
7074 : Probably not worth prompting for this since we prompt for all
7075 : the directories individually, and the prompt would be too long and
7079 : determine where public executables go
7084 rp='Pathname where the public executables will reside?'
7086 if $test "X$ansexp" != "X$binexp"; then
7090 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7091 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7092 : this via initialinstalllocation
7095 case "$userelocatableinc" in
7096 $define|true|[yY]*) dflt='y' ;;
7101 Would you like to build Perl so that the installation is relocatable, so that
7102 library paths in @INC are determined relative to the path of the perl binary?
7103 This is not advised for system Perl installs, or if you need to run setid
7104 scripts or scripts under taint mode.
7106 If this doesn't make any sense to you, just accept the default '$dflt'.
7108 rp='Use relocatable @INC?'
7111 y|Y) val="$define" ;;
7114 set userelocatableinc
7117 initialinstalllocation="$binexp"
7118 : Default prefix is now "up one level from where the binaries are"
7119 case "$userelocatableinc" in
7125 installprefixexp=".../.."
7129 : determine where private library files go
7130 : Usual default is /usr/local/lib/perl5/$version.
7131 : Also allow things like /opt/perl/lib/$version, since
7132 : /opt/perl/lib/perl5... would be redundant.
7133 : The default "style" setting is made in installstyle.U
7134 case "$installstyle" in
7135 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7136 *) set dflt privlib lib/$version ;;
7141 There are some auxiliary files for $package that need to be put into a
7142 private library directory that is accessible by everyone.
7147 rp='Pathname where the private library files will reside?'
7152 : set the prefixup variable, to restore leading tilda escape
7153 prefixup='case "$prefixexp" in
7155 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7158 : determine where public architecture dependent libraries go
7161 : privlib default is /usr/local/lib/$package/$version
7162 : archlib default is /usr/local/lib/$package/$version/$archname
7163 : privlib may have an optional trailing /share.
7164 tdflt=`echo $privlib | $sed 's,/share$,,'`
7165 tdflt=$tdflt/$archname
7174 $spackage contains architecture-dependent library files. If you are
7175 sharing libraries in a heterogeneous environment, you might store
7176 these files in a separate location. Otherwise, you can just include
7177 them with the rest of the public library files.
7182 rp='Where do you want to put the public architecture-dependent libraries?'
7186 if $test X"$archlib" = X"$privlib"; then
7192 : see if setuid scripts can be secure
7195 Some kernels have a bug that prevents setuid #! scripts from being
7196 secure. Some sites have disabled setuid #! scripts because of this.
7198 First let's decide if your kernel supports secure setuid #! scripts.
7199 (If setuid #! scripts would be secure but have been disabled anyway,
7200 don't say that they are secure if asked.)
7205 if $test -d /dev/fd; then
7206 echo "#!$ls" >reflect
7207 chmod +x,u+s reflect
7208 ./reflect >flect 2>&1
7209 if $contains "/dev/fd" flect >/dev/null; then
7210 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7214 If you are not sure if they are secure, I can check but I'll need a
7215 username and password different from the one you are using right now.
7216 If you don't have such a username or don't want me to test, simply
7220 rp='Other username to test security of setuid scripts with?'
7225 case "$d_suidsafe" in
7226 '') echo "I'll assume setuid scripts are *not* secure." >&4
7229 echo "Well, the $hint value is *not* secure." >&4
7231 *) echo "Well, the $hint value *is* secure." >&4
7236 $rm -f reflect flect
7237 echo "#!$ls" >reflect
7238 chmod +x,u+s reflect
7241 echo '"su" will (probably) prompt you for '"$ans's password."
7242 su $ans -c './reflect >flect'
7243 if $contains "/dev/fd" flect >/dev/null; then
7244 echo "Okay, it looks like setuid scripts are secure." >&4
7247 echo "I don't think setuid scripts are secure." >&4
7252 rp='Does your kernel have *secure* setuid scripts?'
7255 [yY]*) val="$define";;
7260 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7261 echo "(That's for file descriptors, not floppy disks.)"
7267 $rm -f reflect flect
7269 : now see if they want to do setuid emulation
7270 if $test $patchlevel -lt 11; then
7273 case "$d_suidsafe" in
7276 echo "No need to emulate SUID scripts since they are secure here." >&4
7280 Some systems have disabled setuid scripts, especially systems where
7281 setuid scripts cannot be secure. On systems where setuid scripts have
7282 been disabled, the setuid/setgid bits on scripts are currently
7283 useless. It is possible for $package to detect those bits and emulate
7284 setuid/setgid in a secure fashion. This emulation will only work if
7285 setuid scripts have been disabled in your kernel.
7289 "$define") dflt=y ;;
7292 rp="Do you want to do setuid/setgid emulation?"
7295 [yY]*) val="$define";;
7307 SUID emulation has been removed for 5.12
7308 Please re-run Configure without -Dd_dosuid
7317 : Find perl5.005 or later.
7318 echo "Looking for a previously installed perl5.005 or later... "
7320 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7321 : Check if this perl is recent and can load a simple module
7322 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7325 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7335 '') echo "None found. That's ok.";;
7336 *) echo "Using $perl5." ;;
7339 : Set the siteprefix variables
7342 After $package is installed, you may wish to install various
7343 add-on modules and utilities. Typically, these add-ons will
7344 be installed under $prefix with the rest
7345 of this package. However, you may wish to install such add-ons
7346 elsewhere under a different prefix.
7348 If you do not wish to put everything under a single prefix, that's
7349 ok. You will be prompted for the individual locations; this siteprefix
7350 is only used to suggest the defaults.
7352 The default should be fine for most people.
7356 rp='Installation prefix to use for add-on modules and utilities?'
7357 : XXX Here might be another good place for an installstyle setting.
7358 case "$siteprefix" in
7360 *) dflt=$siteprefix ;;
7363 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7365 case "$siteprefix" in
7369 *) oldsiteprefix="$prefix";;
7374 siteprefixexp="$ansexp"
7376 : determine where site specific libraries go.
7377 : Usual default is /usr/local/lib/perl5/site_perl/$version
7378 : The default "style" setting is made in installstyle.U
7379 : XXX No longer works with Prefixit stuff.
7380 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7382 '') case "$installstyle" in
7383 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7384 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7392 The installation process will create a directory for
7393 site-specific extensions and modules. Most users find it convenient
7394 to place all site-specific files in this directory rather than in the
7395 main distribution directory.
7399 rp='Pathname for the site-specific library files?'
7403 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7405 : Determine list of previous versions to include in @INC
7406 $cat > getverlist <<EOPL
7409 \$api_versionstring = "$api_versionstring";
7410 \$version = "$version";
7411 \$stem = "$sitelib_stem";
7412 \$archname = "$archname";
7414 $cat >> getverlist <<'EOPL'
7415 # The list found is store twice for each entry: the original name, and
7416 # the binary broken down version as pack "sss", so sorting is easy and
7417 # unambiguous. This will work for all versions that have a maximum of
7418 # three digit groups, separate by '.'s or '_'s. Names are extended with
7419 # ".0.0" to ensure at least three elements for the pack.
7420 # -- H.Merijn Brand (m)'06 23-10-2006
7422 # Can't have leading @ because metaconfig interprets it as a command!
7423 ;@inc_version_list=();
7424 # XXX Redo to do opendir/readdir?
7427 ;@candidates = map {
7428 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7429 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7435 ($pversion, $aversion, $vsn5005) = map {
7436 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7437 foreach $d (@candidates) {
7438 if ($d->[1] lt $pversion) {
7439 if ($d->[1] ge $aversion) {
7440 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7442 elsif ($d->[1] ge $vsn5005) {
7443 unshift(@inc_version_list, grep { -d } $d->[0]);
7447 # Skip newer version. I.e. don't look in
7448 # 5.7.0 if we're installing 5.6.1.
7452 if (@inc_version_list) {
7453 print join(' ', @inc_version_list);
7456 # Blank space to preserve value for next Configure run.
7461 case "$inc_version_list" in
7462 '') if test -x "$perl5$exe_ext"; then
7463 dflt=`$perl5 getverlist`
7468 $undef) dflt='none' ;;
7469 *) eval dflt=\"$inc_version_list\" ;;
7472 ''|' ') dflt=none ;;
7479 In order to ease the process of upgrading, this version of perl
7480 can be configured to use modules built and installed with earlier
7481 versions of perl that were installed under $prefix. Specify here
7482 the list of earlier versions that this version of perl should check.
7483 If Configure detected no earlier versions of perl installed under
7484 $prefix, then the list will be empty. Answer 'none' to tell perl
7485 to not search earlier versions.
7487 The default should almost always be sensible, so if you're not sure,
7488 just accept the default.
7491 rp='List of earlier versions to include in @INC?'
7494 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7495 *) inc_version_list="$ans" ;;
7497 case "$inc_version_list" in
7499 inc_version_list_init='0'
7500 d_inc_version_list="$undef"
7502 *) inc_version_list_init=`echo $inc_version_list |
7503 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7504 d_inc_version_list="$define"
7509 : see if malloc/malloc.h has to be included
7510 set malloc/malloc.h i_mallocmalloc
7513 : see if this is a malloc.h system
7514 : we want a real compile instead of Inhdr because some systems have a
7515 : malloc.h that just gives a compile error saying to use stdlib.h instead
7520 #$i_mallocmalloc I_MALLOCMALLOC
7521 #ifdef I_MALLOCMALLOC
7522 # include <malloc/malloc.h>
7525 int main () { return 0; }
7528 if eval $compile; then
7529 echo "<malloc.h> found." >&4
7532 echo "<malloc.h> NOT found." >&4
7539 : check for length of pointer
7543 echo "Checking to see how big your pointers are..." >&4
7552 printf("%d\n", (int)sizeof(void *));
7557 if eval $compile_ok; then
7558 ptrsize=`$run ./try`
7559 echo "Your pointers are $ptrsize bytes long."
7562 echo "(I can't seem to compile the test program. Guessing...)" >&4
7563 rp="What is the size of a pointer (in bytes)?"
7570 case "$use64bitall" in
7571 "$define"|true|[yY]*)
7575 *** You have chosen a maximally 64-bit build,
7576 *** but your pointers are only 4 bytes wide.
7577 *** Please rerun Configure without -Duse64bitall.
7582 *** Since you have quads, you could possibly try with -Duse64bitint.
7587 *** Cannot continue, aborting.
7598 : determine whether to use malloc wrapping
7600 case "$usemallocwrap" in
7601 [yY]*|true|$define) dflt='y' ;;
7602 [nN]*|false|$undef) dflt='n' ;;
7603 *) case "$usedevel" in
7604 [yY]*|true|$define) dflt='y' ;;
7609 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7611 usemallocwrap="$ans"
7614 usemallocwrap="$define" ;;
7616 usemallocwrap="$undef" ;;
7619 : determine which malloc to compile in
7621 case "$usemymalloc" in
7622 [yY]*|true|$define) dflt='y' ;;
7623 [nN]*|false|$undef) dflt='n' ;;
7624 *) case "$ptrsize" in
7628 if test "$useithreads" = "$define"; then dflt='n'; fi
7631 rp="Do you wish to attempt to use the malloc that comes with $package?"
7637 mallocsrc='malloc.c'
7638 mallocobj="malloc$_o"
7639 d_mymalloc="$define"
7642 : Remove malloc from list of libraries to use
7643 echo "Removing unneeded -lmalloc from library list" >&4
7644 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7647 echo "libs = $libs" >&4
7659 : compute the return types of malloc and free
7661 $cat >malloc.c <<END
7665 #include <sys/types.h>
7679 case "$malloctype" in
7681 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7688 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7692 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7699 echo "Your system uses $freetype free(), it would seem." >&4
7701 : determine where site specific architecture-dependent libraries go.
7702 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7703 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7704 : sitelib may have an optional trailing /share.
7706 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7707 dflt="$dflt/$archname"
7712 set sitearch sitearch none
7716 The installation process will also create a directory for
7717 architecture-dependent site-specific extensions and modules.
7721 rp='Pathname for the site-specific architecture-dependent library files?'
7725 if $test X"$sitearch" = X"$sitelib"; then
7728 d_sitearch="$define"
7731 : Set the vendorprefix variables
7734 The installation process will also create a directory for
7735 vendor-supplied add-ons. Vendors who supply perl with their system
7736 may find it convenient to place all vendor-supplied files in this
7737 directory rather than in the main distribution directory. This will
7738 ease upgrades between binary-compatible maintenance versions of perl.
7740 Of course you may also use these directories in whatever way you see
7741 fit. For example, you might use them to access modules shared over a
7742 company-wide network.
7744 The default answer should be fine for most people.
7745 This causes further questions about vendor add-ons to be skipped
7746 and no vendor-specific directories will be configured for perl.
7749 rp='Do you want to configure vendor-specific add-on directories?'
7750 case "$usevendorprefix" in
7751 define|true|[yY]*) dflt=y ;;
7752 *) : User may have set vendorprefix directly on Configure command line.
7753 case "$vendorprefix" in
7762 rp='Installation prefix to use for vendor-supplied add-ons?'
7763 case "$vendorprefix" in
7764 '') dflt="$prefix" ;;
7765 *) dflt=$vendorprefix ;;
7768 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7770 case "$vendorprefix" in
7774 *) oldvendorprefix="$prefix";;
7778 usevendorprefix="$define"
7780 vendorprefixexp="$ansexp"
7782 *) usevendorprefix="$undef"
7788 : Set the vendorlib variables
7789 case "$vendorprefix" in
7790 '') d_vendorlib="$undef"
7794 *) d_vendorlib="$define"
7795 : determine where vendor-supplied modules go.
7796 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7797 case "$vendorlib" in
7799 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7800 case "$installstyle" in
7801 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7802 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7805 *) dflt="$vendorlib"
7809 rp='Pathname for the vendor-supplied library files?'
7812 vendorlibexp="$ansexp"
7815 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7819 : Set the vendorarch variables
7820 case "$vendorprefix" in
7821 '') d_vendorarch="$undef"
7825 *) d_vendorarch="$define"
7826 : determine where vendor-supplied architecture-dependent libraries go.
7827 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7828 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7829 : vendorlib may have an optional trailing /share.
7830 case "$vendorarch" in
7831 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7832 dflt="$dflt/$archname"
7834 *) dflt="$vendorarch" ;;
7837 rp='Pathname for vendor-supplied architecture-dependent files?'
7840 vendorarchexp="$ansexp"
7843 prefixvar=vendorarch
7845 if $test X"$vendorarch" = X"$vendorlib"; then
7846 d_vendorarch="$undef"
7848 d_vendorarch="$define"
7851 : Final catch-all directories to search
7854 Lastly, you can have perl look in other directories for extensions and
7855 modules in addition to those already specified.
7856 These directories will be searched after
7860 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7861 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7863 case "$otherlibdirs" in
7864 ''|' ') dflt='none' ;;
7865 *) dflt="$otherlibdirs" ;;
7868 Enter a colon-separated set of extra paths to include in perl's @INC
7869 search path, or enter 'none' for no extra paths.
7873 rp='Colon-separated list of additional directories for perl to search?'
7876 ' '|''|none) otherlibdirs=' ' ;;
7877 *) otherlibdirs="$ans" ;;
7879 case "$otherlibdirs" in
7883 set d_perl_otherlibdirs
7886 : Cruising for prototypes
7888 echo "Checking out function prototypes..." >&4
7889 $cat >prototype.c <<EOCP
7894 int main(int argc, char *argv[]) {
7897 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7898 echo "Your C compiler appears to support function prototypes."
7901 echo "Your C compiler doesn't seem to understand function prototypes."
7908 : Check if ansi2knr is required
7909 case "$prototype" in
7911 *) ansi2knr='ansi2knr'
7916 This version of $package can only be compiled by a compiler that
7917 understands function prototypes. Unfortunately, your C compiler
7919 doesn't seem to understand them. Sorry about that.
7921 If GNU cc is available for your system, perhaps you could try that instead.
7923 Eventually, we hope to support building Perl with pre-ANSI compilers.
7924 If you would like to help in that effort, please contact <perlbug@perl.org>.
7926 Aborting Configure now.
7933 dflt_dtrace='/usr/sbin/dtrace'
7934 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7938 Perl can be built to support DTrace on platforms that support it.
7939 DTrace is a diagnosis and performance analysis tool from Sun.
7941 If this doesn't make any sense to you, just accept the default '$dflt'.
7945 case "$usedtrace" in
7951 dflt_dtrace=$usedtrace
7958 rp='Support DTrace if available?'
7961 y|Y) val="$define" ;;
7967 test "X$usedtrace" != "X$define" && break
7970 rp='Where is the dtrace executable?'
7979 if $dtrace -h -s ../perldtrace.d \
7980 -o perldtrace.tmp >/dev/null 2>&1 \
7981 && rm -f perldtrace.tmp
7984 echo "Good: your $dtrace knows about the -h flag."
7988 *** $me: Fatal Error: $dtrace doesn't support -h flag
7990 *** Your installed dtrace doesn't support the -h switch to compile a D
7991 *** program into a C header. Can't continue.
8003 *** $me: Fatal Error: $dtrace not found.
8010 echo "*** $dtrace was not found."
8016 : See if we want extra modules installed
8023 Perl can be built with extra modules or bundles of modules which
8024 will be fetched from the CPAN and installed alongside Perl.
8026 Notice that you will need access to the CPAN; either via the Internet,
8027 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8028 be asked later to configure the CPAN.pm module which will in turn do
8029 the installation of the rest of the extra modules or bundles.)
8031 Notice also that if the modules require any external software such as
8032 libraries and headers (the libz library and the zlib.h header for the
8033 Compress::Zlib module, for example) you MUST have any such software
8034 already installed, this configuration process will NOT install such
8037 If this doesn't make any sense to you, just accept the default '$dflt'.
8039 rp='Install any extra modules (y or n)?'
8045 Please list any extra modules or bundles to be installed from CPAN,
8046 with spaces between the names. The names can be in any format the
8047 'install' command of CPAN.pm will understand. (Answer 'none',
8048 without the quotes, to install no extra modules or bundles.)
8058 $rm -f ../extras.lst
8060 *) echo "(Saving the list of extras for later...)"
8061 echo "$extras" > ../extras.lst
8069 : determine where html pages for programs go
8070 set html1dir html1dir none
8074 If you wish to install html files for programs in $spackage, indicate
8075 the appropriate directory here. To skip installing html files,
8079 ''|none|$undef|' ') dflt=none ;;
8080 *) dflt=$html1dir ;;
8083 rp="Directory for the main $spackage html pages?"
8087 : Use ' ' for none so value is preserved next time through Configure
8088 $test X"$html1dir" = "X" && html1dir=' '
8090 : determine where html pages for libraries and modules go
8091 set html3dir html3dir none
8095 If you wish to install html files for modules associated with $spackage,
8096 indicate the appropriate directory here. To skip installing html files,
8099 : There is no obvious default. If they have specified html1dir, then
8100 : try to key off that, possibly changing .../html1 into .../html3.
8102 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8103 *) dflt=$html3dir ;;
8106 rp="Directory for the $spackage module html pages?"
8110 : Use ' ' for none so value is preserved next time through Configure
8111 $test X"$html3dir" = "X" && html3dir=' '
8113 : determine whether to install perl also as /usr/bin/perl
8116 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8118 Many scripts expect perl to be installed as /usr/bin/perl.
8120 If you want to, I can install the perl you are about to compile
8121 as /usr/bin/perl (in addition to $bin/perl).
8123 if test -f /usr/bin/perl; then
8126 However, please note that because you already have a /usr/bin/perl,
8127 overwriting that with a new Perl would very probably cause problems.
8128 Therefore I'm assuming you don't want to do that (unless you insist).
8131 case "$installusrbinperl" in
8132 "$define"|[yY]*) dflt='y';;
8138 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8141 case "$installusrbinperl" in
8142 "$undef"|[nN]*) dflt='n';;
8146 rp="Do you want to install perl as /usr/bin/perl?"
8149 [yY]*) val="$define";;
8155 set installusrbinperl
8158 : see if dlopen exists
8160 xxx_ccflags="$ccflags"
8162 : with g++ one needs -shared to get is-in-libc to work for dlopen
8163 case "$gccversion" in
8165 *) case "$d_cplusplus" in
8166 "$define") ccflags="$ccflags -shared" ;;
8173 ccflags="$xxx_ccflags"
8175 : see if this is a unistd.h system
8176 set unistd.h i_unistd
8179 : determine which dynamic loading, if any, to compile in
8181 dldir="ext/DynaLoader"
8194 $define) dflt='y' ;;
8196 : Does a dl_xxx.xs file exist for this operating system
8197 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8200 rp="Do you wish to use dynamic loading?"
8207 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8208 dflt="$dldir/dl_${osname}.xs"
8209 elif $test "$d_dlopen" = "$define" ; then
8210 dflt="$dldir/dl_dlopen.xs"
8215 *) dflt="$dldir/$dlsrc"
8218 echo "The following dynamic loading files are available:"
8219 : Can not go over to $dldir because getfile has path hard-coded in.
8220 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8221 rp="Source file to use for dynamic loading"
8227 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8231 Some systems may require passing special flags to $cc -c to
8232 compile modules that will be used to create a shared library.
8233 To use no flags, say "none".
8236 case "$cccdlflags" in
8237 '') case "$gccversion" in
8238 '') case "$osname" in
8240 irix*) dflt='-KPIC' ;;
8241 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8242 sunos) dflt='-pic' ;;
8246 *) case "$osname" in
8247 darwin) dflt='none' ;;
8248 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8253 *) dflt="$cccdlflags" ;;
8260 # If -Dsysroot was specified, now's the time to add it
8262 if test "X$sysroot" != X; then
8263 case "$gccversion" in
8268 dflt="$dflt --sysroot=$sysroot" ;;
8278 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8281 none) cccdlflags=' ' ;;
8282 *) cccdlflags="$ans" ;;
8287 Some systems use ld to create libraries that can be dynamically loaded,
8288 while other systems (such as those using ELF) use $cc.
8292 : Determine if this is ELF
8294 /* Test for whether ELF binaries are produced */
8306 int i = open("a.out",O_RDONLY);
8309 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8310 exit(0); /* succeed (yes, it is ELF) */
8314 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8320 '') if $test $bin_ELF = "$define"; then
8322 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8326 echo "I'll use ld to build dynamic libraries."
8334 rp="What command should be used to create dynamic libraries?"
8340 Some systems may require passing special flags to $ld to create a
8341 library that can be dynamically loaded. If your ld flags include
8342 -L/other/path options to locate libraries outside your loader's normal
8343 search path, you may need to specify those -L options here as well. To
8344 use no flags, say "none".
8347 case "$lddlflags" in
8348 '') case "$osname" in
8349 haiku) dflt='-shared' ;;
8351 case "$gccversion" in
8352 '') dflt="$dflt +vnocompatwarnings" ;;
8355 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8356 solaris) # See [perl #66604].
8357 # On Solaris 11, gcc -m64 on amd64
8358 # appears not to understand -G. gcc versions at
8359 # least as old as 3.4.3 support -shared, so just
8360 # use that with Solaris 11 and later, but keep
8361 # the old behavior for older Solaris versions.
8362 case "$gccversion" in
8364 *) case "$osvers" in
8365 2.?|2.10) dflt='-G' ;;
8366 *) dflt='-shared' ;;
8371 sunos) dflt='-assert nodefinitions' ;;
8372 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8376 *) dflt="$lddlflags" ;;
8379 : Only do this for gcc, since, for example, qcc has no concept
8381 if $test "X$sysroot" != X; then
8382 case "$gccversion" in
8384 *) dflt="$dflt --sysroot $sysroot" ;;
8388 : Try to guess additional flags to pick up local libraries.
8389 : Be careful not to append to a plain 'none'
8393 for thisflag in $ldflags; do
8398 *) dflt="$dflt $thisflag" ;;
8405 ''|' ') dflt='none' ;;
8409 *-fstack-protector*)
8411 *-fstack-protector*) ;; # Don't add it again
8412 *) dflt="$dflt -fstack-protector" ;;
8417 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8420 none) lddlflags=' ' ;;
8421 *) lddlflags="$ans" ;;
8426 Some systems may require passing special flags to $cc to indicate that
8427 the resulting executable will use dynamic linking. To use no flags,
8431 case "$ccdlflags" in
8432 '') case "$osname" in
8433 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8434 sunos) dflt='none' ;;
8438 *) dflt="$ccdlflags" ;;
8440 rp="Any special flags to pass to $cc to use dynamic linking?"
8443 none) ccdlflags=' ' ;;
8444 *) ccdlflags="$ans" ;;
8456 ld_can_script="$undef"
8457 case "$bin_ELF$usedl" in
8459 # Abuse try.h and a.out names for neat cleanup
8471 if $cc $cccdlflags $ccdlflags $ccflags \
8472 $ldflags $lddlflags -o a.out try.c \
8473 -Wl,--version-script=try.h >/dev/null 2>&1 \
8474 && $test -s a.out ; then
8475 echo "ld supports scripting" >&4
8476 ld_can_script="$define"
8478 echo "ld does not support scripting" >&4
8484 : Do we want a shared libperl?
8488 # No dynamic loading being used, so don't bother even to prompt.
8491 *) case "$useshrplib" in
8492 '') case "$osname" in
8493 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8495 also='Building a shared libperl is required for dynamic loading to work on your system.'
8509 The perl executable is normally obtained by linking perlmain.c with
8510 libperl${_a}, any static extensions (usually just DynaLoader), and
8511 any other libraries needed on this system (such as -lm, etc.). Since
8512 your system supports dynamic loading, it is probably possible to build
8513 a shared libperl.$so. If you will have more than one executable linked
8514 to libperl.$so, this will significantly reduce the size of each
8515 executable, but it may have a noticeable effect on performance. The
8516 default is probably sensible for your system.
8520 rp="Build a shared libperl.$so (y/n)"
8524 useshrplib='true' ;;
8525 *) useshrplib='false' ;;
8530 case "$useshrplib" in
8532 case "$userelocatableinc" in
8534 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8535 echo "See INSTALL for an explanation why that won't work." >&4
8541 # Figure out a good name for libperl.so. Since it gets stored in
8542 # a version-specific architecture-dependent library, the version
8543 # number isn't really that important, except for making cc/ld happy.
8545 # A name such as libperl.so.10.1
8546 majmin="libperl.$so.$patchlevel.$subversion"
8547 # A name such as libperl.so.100
8548 majonly=`echo $patchlevel $subversion |
8549 $awk '{printf "%d%02d", $1, $2}'`
8550 majonly=libperl.$so.$majonly
8551 # I'd prefer to keep the os-specific stuff here to a minimum, and
8552 # rely on figuring it out from the naming of libc.
8553 case "${osname}${osvers}" in
8554 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8557 cygwin*) # ld links now against the dll directly
8558 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8559 majonly=`echo $patchlevel $subversion |
8560 $awk '{printf "%03d%03d", $1, $2}'`
8561 majonly=cygperl5.$majonly.$so
8564 *) # Try to guess based on whether libc has major.minor.
8566 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8567 *libc.$so.[0-9]*) dflt=$majonly ;;
8568 *) dflt=libperl.$so ;;
8578 I need to select a good name for the shared libperl. If your system uses
8579 library names with major and minor numbers, then you might want something
8580 like $majmin. Alternatively, if your system uses a single version
8581 number for shared libraries, then you might want to use $majonly.
8582 Or, your system might be quite happy with a simple libperl.$so.
8584 Since the shared libperl will get installed into a version-specific
8585 architecture-dependent directory, the version number of the shared perl
8586 library probably isn't important, so the default should be o.k.
8589 rp='What name do you want to give to the shared libperl?'
8592 echo "Ok, I'll use $libperl"
8595 libperl="libperl${_a}"
8599 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8603 WARNING: Use of the shrpdir variable for the installation location of
8604 the shared $libperl is not supported. It was never documented and
8605 will not work in this version. Let me (perlbug@perl.org)
8606 know of any problems this may cause.
8612 But your current setting of $shrpdir is
8613 the default anyway, so it's harmless.
8618 Further, your current attempted setting of $shrpdir
8619 conflicts with the value of $archlibexp/CORE
8620 that installperl will use.
8627 # How will the perl executable find the installed shared $libperl?
8628 # Add $xxx to ccdlflags.
8629 # If we can't figure out a command-line option, use $shrpenv to
8630 # set env LD_RUN_PATH. The main perl makefile uses this.
8631 shrpdir=$archlibexp/CORE
8634 if "$useshrplib"; then
8637 # We'll set it in Makefile.SH...
8642 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8643 xxx="-Wl,-R$shrpdir"
8645 bsdos|linux|irix*|dec_osf|gnu*)
8646 xxx="-Wl,-rpath,$shrpdir"
8649 # Haiku doesn't like the default, either.
8652 # hpux doesn't like the default, either.
8653 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8656 # cygwin needs only ldlibpth
8659 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8665 # Only add $xxx if it isn't already in ccdlflags.
8666 case " $ccdlflags " in
8668 *) ccdlflags="$ccdlflags $xxx"
8671 Adding $xxx to the flags
8672 passed to $ld so that the perl executable will find the
8673 installed shared $libperl.
8681 # Fix ccdlflags in AIX for building external extensions.
8682 # (For building Perl itself bare -bE:perl.exp is needed,
8683 # Makefile.SH takes care of this.)
8685 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8687 # Respect a hint or command-line value.
8689 '') shrpenv="$tmp_shrpenv" ;;
8691 case "$ldlibpthname" in
8692 '') ldlibpthname=LD_LIBRARY_PATH ;;
8693 none) ldlibpthname='' ;;
8696 : determine where manual pages are on this system
8700 syspath='/usr/share/man/man1 /usr/man/man1'
8701 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8702 syspath="$syspath /usr/man/u_man/man1"
8703 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8704 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8705 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8706 sysman=`./loc . /usr/man/man1 $syspath`
8709 if $test -d "$sysman"; then
8710 echo "System manual is in $sysman." >&4
8712 echo "Could not find manual pages in source form." >&4
8715 : determine where manual pages go
8716 set man1dir man1dir none
8720 $spackage has manual pages available in source form.
8724 echo "However, you don't have nroff, so they're probably useless to you."
8726 '') man1dir="none";;
8729 echo "If you don't want the manual sources installed, answer 'none'."
8734 lookpath="$prefixexp/share/man/man1"
8735 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8736 lookpath="$lookpath $prefixexp/man/p_man/man1"
8737 lookpath="$lookpath $prefixexp/man/u_man/man1"
8738 lookpath="$lookpath $prefixexp/man/man.1"
8740 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8741 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8751 rp="Where do the main $spackage manual pages (source) go?"
8753 if $test "X$man1direxp" != "X$ansexp"; then
8764 : What suffix to use on installed man pages
8771 rp="What suffix should be used for the main $spackage man pages?"
8773 '') case "$man1dir" in
8787 *) dflt="$man1ext";;
8794 : see if we can have long filenames
8796 first=123456789abcdef
8798 if (echo hi >$first) 2>/dev/null; then
8799 if $test -f 123456789abcde; then
8800 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8803 echo 'You can have filenames longer than 14 characters.'>&4
8808 You can't have filenames longer than 14 chars.
8809 You can't even think about them!
8815 $rm -rf 123456789abcde*
8817 : determine where library module manual pages go
8818 set man3dir man3dir none
8822 $spackage has manual pages for many of the library modules.
8828 However, you don't have nroff, so they're probably useless to you.
8831 '') man3dir="none";;
8835 case "$d_flexfnam" in
8838 However, your system can't handle the long file names like File::Basename.3.
8841 '') man3dir="none";;
8845 echo "If you don't want the manual sources installed, answer 'none'."
8846 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8848 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8849 if $test -d "$privlib/man/man3"; then
8852 WARNING: Previous versions of perl installed man3 pages into
8853 $privlib/man/man3. This version will suggest a
8854 new default of $dflt.
8858 rp='Do you wish to preserve the old behavior?(y/n)'
8861 y*) dflt="$privlib/man/man3" ;;
8866 *) dflt="$man3dir" ;;
8873 rp="Where do the $package library man pages (source) go?"
8883 : What suffix to use on installed man pages
8889 rp="What suffix should be used for the $package library man pages?"
8891 '') case "$man3dir" in
8905 *) dflt="$man3ext";;
8912 : see if we have to deal with yellow pages, now NIS.
8913 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8919 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8927 rp='Are you getting the hosts file via yellow pages?'
8930 y*) hostcat='ypcat hosts';;
8931 *) hostcat='cat /etc/hosts';;
8937 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8940 '') test -f /etc/group && groupcat='cat /etc/group';;
8943 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8946 : now get the host name
8948 echo "Figuring out host name..." >&4
8949 case "$myhostname" in
8951 echo 'Maybe "hostname" will work...'
8952 if tans=`sh -c hostname 2>&1` ; then
8960 if $test "$cont"; then
8962 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8963 if tans=`cat /etc/systemid 2>&1` ; then
8965 phostname='cat /etc/systemid'
8966 echo "Whadyaknow. Xenix always was a bit strange..."
8969 elif $test -r /etc/systemid; then
8970 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8973 if $test "$cont"; then
8974 echo 'No, maybe "uuname -l" will work...'
8975 if tans=`sh -c 'uuname -l' 2>&1` ; then
8977 phostname='uuname -l'
8979 echo 'Strange. Maybe "uname -n" will work...'
8980 if tans=`sh -c 'uname -n' 2>&1` ; then
8982 phostname='uname -n'
8984 echo 'Oh well, maybe I can mine it out of whoami.h...'
8985 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8986 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8987 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8989 case "$myhostname" in
8990 '') echo "Does this machine have an identity crisis or something?"
8993 echo "Well, you said $myhostname before..."
8994 phostname='echo $myhostname';;
9000 case "$myhostname" in
9001 '') myhostname=noname ;;
9003 : you do not want to know about this
9008 if $test "$myhostname" ; then
9010 rp='Your host name appears to be "'$myhostname'".'" Right?"
9018 : bad guess or no guess
9019 while $test "X$myhostname" = X ; do
9021 rp="Please type the (one word) name of your host:"
9026 : translate upper to lower if necessary
9027 case "$myhostname" in
9029 echo "(Normalizing case in your host name)"
9030 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9034 case "$myhostname" in
9036 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9037 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9038 echo "(Trimming domain name from host name--host name is now $myhostname)"
9040 *) case "$mydomain" in
9043 test "X$hostcat" = "Xypcat hosts" &&
9044 ypmatch "$myhostname" hosts 2>/dev/null |\
9045 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9048 test "X$hostcat" != "X" &&
9049 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9050 /[ ]$myhostname[ . ]/p" > hosts
9053 if $test -f hosts; then
9054 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9055 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9056 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9057 hosts | $sort | $uniq | \
9058 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9059 case `$echo X$dflt` in
9060 X*\ *) echo "(Several hosts in the database matched hostname)"
9063 X.) echo "(You do not have fully-qualified names in the hosts database)"
9067 echo "(I cannot locate a hosts database anywhere)"
9072 tans=`./loc resolv.conf X /etc /usr/etc`
9073 if $test -f "$tans"; then
9074 echo "(Attempting domain name extraction from $tans)"
9075 dflt=.`$sed -n -e 's/ / /g' \
9076 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9079 .) dflt=.`$sed -n -e 's/ / /g' \
9080 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9088 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9089 dflt=.`sh -c domainname 2>/dev/null`
9092 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9096 case "$dflt$osname" in
9097 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9098 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9102 .) echo "(Lost all hope -- silly guess then)"
9108 *) dflt="$mydomain";;
9112 rp="What is your domain name?"
9122 : translate upper to lower if necessary
9125 echo "(Normalizing case in your domain name)"
9126 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9130 : a little sanity check here
9131 case "$phostname" in
9134 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9135 $myhostname$mydomain|$myhostname) ;;
9137 case "$phostname" in
9139 echo "(That doesn't agree with your whoami.h file, by the way.)"
9142 echo "(That doesn't agree with your $phostname command, by the way.)"
9150 : determine the e-mail address of the user who is running us
9153 I need to get your e-mail address in Internet format if possible, i.e.
9154 something like user@host.domain. Please answer accurately since I have
9155 no easy means to double check it. The default value provided below
9156 is most probably close to reality but may not be valid from outside
9157 your organization...
9161 while test "$cont"; do
9162 case "$MAILDOMAIN" in
9164 if $test -s /etc/mailname; then
9165 maildomain=`$cat /etc/mailname`
9167 maildomain="$myhostname$mydomain"
9170 *) maildomain="$MAILDOMAIN";;
9173 '') dflt="$cf_by@$maildomain";;
9174 *) dflt="$cf_email";;
9176 rp='What is your e-mail address?'
9182 rp='Address does not look like an Internet one. Use it anyway?'
9196 : Ask e-mail of administrator
9199 If you or somebody else will be maintaining perl at your site, please
9200 fill in the correct e-mail address here so that they may be contacted
9201 if necessary. Currently, the "perlbug" program included with perl
9202 will send mail to this address in addition to perlbug@perl.org. You may
9203 enter "none" for no administrator.
9206 case "$perladmin" in
9207 '') dflt="$cf_email";;
9208 *) dflt="$perladmin";;
9210 rp='Perl administrator e-mail address'
9214 : determine whether to only install version-specific parts.
9217 Do you want to install only the version-specific parts of the perl
9218 distribution? Usually you do *not* want to do this.
9220 case "$versiononly" in
9221 "$define"|[Yy]*|true) dflt='y' ;;
9224 rp="Do you want to install only the version-specific parts of perl?"
9227 [yY]*) val="$define";;
9233 case "$versiononly" in
9234 "$define") inc_version_list=''
9235 inc_version_list_init=0
9239 : figure out how to guarantee perl startup
9240 : XXX Note that this currently takes advantage of the bug that binexp ignores
9241 : the Configure -Dinstallprefix setting, which in turn means that under
9242 : relocatable @INC, initialinstalllocation is what binexp started as.
9243 case "$startperl" in
9245 case "$sharpbang" in
9249 I can use the #! construct to start perl on your system. This will
9250 make startup of perl scripts faster, but may cause problems if you
9251 want to share those scripts and perl is not in a standard place
9252 ($initialinstalllocation/perl) on all your platforms. The alternative
9253 is to force a shell by starting the script with a single ':' character.
9256 case "$versiononly" in
9257 "$define") dflt="$initialinstalllocation/perl$version";;
9258 *) dflt="$initialinstalllocation/perl";;
9260 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9263 none) startperl=": # use perl";;
9264 *) startperl="#!$ans"
9265 if $test 30 -lt `echo "$ans" | wc -c`; then
9268 WARNING: Some systems limit the #! command to 32 characters.
9269 If you experience difficulty running Perl scripts with #!, try
9270 installing Perl in a directory with a shorter pathname.
9276 *) startperl=": # use perl"
9281 echo "I'll use $startperl to start perl scripts."
9283 : figure best path for perl in scripts
9286 case "$versiononly" in
9287 "$define") perlpath="$initialinstalllocation/perl$version";;
9288 *) perlpath="$initialinstalllocation/perl";;
9290 case "$startperl" in
9295 I will use the "eval 'exec'" idiom to start Perl on your system.
9296 I can use the full path of your Perl binary for this purpose, but
9297 doing so may cause problems if you want to share those scripts and
9298 Perl is not always in a standard place ($initialinstalllocation/perl).
9301 dflt="$initialinstalllocation/perl"
9302 rp="What path shall I use in \"eval 'exec'\"?"
9309 case "$startperl" in
9311 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9314 : determine where public executable scripts go
9315 set scriptdir scriptdir
9317 case "$scriptdir" in
9320 : guess some guesses
9321 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9322 $test -d /usr/share/bin && dflt=/usr/share/bin
9323 $test -d /usr/local/script && dflt=/usr/local/script
9324 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9325 $test -d $prefixexp/script && dflt=$prefixexp/script
9329 *) dflt="$scriptdir"
9334 Some installations have a separate directory just for executable scripts so
9335 that they can mount it across multiple architectures but keep the scripts in
9336 one spot. You might, for example, have a subdirectory of /usr/share for this.
9337 Or you might just lump your scripts in with all your other executables.
9341 rp='Where do you keep publicly executable scripts?'
9343 if $test "X$ansexp" != "X$scriptdirexp"; then
9349 : A little fix up for an irregularly named variable.
9350 installscript="$installscriptdir"
9352 : determine where add-on public executables go
9354 '') dflt=$siteprefix/bin ;;
9358 rp='Pathname where the add-on public executables should be installed?'
9363 : determine where add-on html pages go
9364 : There is no standard location, so try to copy the previously-selected
9365 : directory structure for the core html pages.
9366 case "$sitehtml1dir" in
9367 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9368 *) dflt=$sitehtml1dir ;;
9371 ''|' ') dflt=none ;;
9374 rp='Pathname where the site-specific html pages should be installed?'
9376 prefixvar=sitehtml1dir
9379 : determine where add-on library html pages go
9380 : There is no standard location, so try to copy the previously-selected
9381 : directory structure for the core html pages.
9382 case "$sitehtml3dir" in
9383 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9384 *) dflt=$sitehtml3dir ;;
9387 ''|' ') dflt=none ;;
9390 rp='Pathname where the site-specific library html pages should be installed?'
9392 prefixvar=sitehtml3dir
9395 : determine where add-on manual pages go
9396 case "$siteman1dir" in
9397 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9398 *) dflt=$siteman1dir ;;
9401 ''|' ') dflt=none ;;
9404 rp='Pathname where the site-specific manual pages should be installed?'
9406 prefixvar=siteman1dir
9409 : determine where add-on library man pages go
9410 case "$siteman3dir" in
9411 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9412 *) dflt=$siteman3dir ;;
9415 ''|' ') dflt=none ;;
9418 rp='Pathname where the site-specific library manual pages should be installed?'
9420 prefixvar=siteman3dir
9423 : determine where add-on public executable scripts go
9424 case "$sitescript" in
9425 '') dflt=$siteprefix/script
9426 $test -d $dflt || dflt=$sitebin ;;
9427 *) dflt="$sitescript" ;;
9430 rp='Pathname where add-on public executable scripts should be installed?'
9432 prefixvar=sitescript
9435 : see if backtrace exists
9436 set backtrace d_backtrace
9439 : add flags if using c backtrace
9440 case "$usecbacktrace" in
9441 "") usecbacktrace=$undef ;;
9443 case "$d_backtrace" in
9445 case " $ccflags " in
9446 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9447 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9451 echo "This system does not support backtrace" >&4
9452 usecbacktrace=$undef
9458 : Check if faststdio is requested and available
9459 case "$usefaststdio" in
9460 $define|true|[yY]*|'')
9461 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9471 Perl can be built to use 'fast stdio', which means using the stdio
9472 library but also directly manipulating the stdio buffers to enable
9473 faster I/O. Using stdio is better for backward compatibility (especially
9474 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9475 interface has been preferred instead of stdio.
9477 If this doesn't make any sense to you, just accept the default '$dflt'.
9479 rp='Use the "fast stdio" if available?'
9482 y|Y) val="$define" ;;
9489 : define an is-a-typedef? function
9490 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9492 "") inclist="sys/types.h";;
9494 eval "varval=\$$var";
9498 for inc in $inclist; do
9499 echo "#include <$inc>" >>temp.c;
9501 echo "#ifdef $type" >> temp.c;
9502 echo "printf(\"We have $type\");" >> temp.c;
9503 echo "#endif" >> temp.c;
9504 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9505 if $contains $type temp.E >/dev/null 2>&1; then
9511 *) eval "$var=\$varval";;
9514 : define an is-a-typedef? function that prompts if the type is not available.
9515 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9517 "") inclist="sys/types.h";;
9519 eval "varval=\$$var";
9523 for inc in $inclist; do
9524 echo "#include <$inc>" >>temp.c;
9526 echo "#ifdef $type" >> temp.c;
9527 echo "printf(\"We have $type\");" >> temp.c;
9528 echo "#endif" >> temp.c;
9529 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9531 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9532 if $contains $type temp.E >/dev/null 2>&1; then
9533 echo "$type found." >&4;
9536 echo "$type NOT found." >&4;
9542 *) eval "$var=\$varval";;
9545 : see what type lseek is declared as in the kernel
9546 rp="What is the type used for lseek's offset on this system?"
9547 set off_t lseektype long stdio.h sys/types.h
9551 echo "Checking to see how big your file offsets are..." >&4
9553 #include <sys/types.h>
9557 printf("%d\n", (int)sizeof($lseektype));
9562 if eval $compile_ok; then
9563 lseeksize=`$run ./try`
9564 echo "Your file offsets are $lseeksize bytes long."
9568 echo "(I can't seem to compile the test program. Guessing...)"
9569 rp="What is the size of your file offsets (in bytes)?"
9575 : see what type file positions are declared as in the library
9576 rp="What is the type for file position used by fsetpos()?"
9577 set fpos_t fpostype long stdio.h sys/types.h
9580 : Check size for Fpos_t
9583 *_t) zzz="$fpostype" ;;
9586 echo "Checking the size of $zzz..." >&4
9588 #include <sys/types.h>
9595 printf("%d\n", (int)sizeof($fpostype));
9600 if eval $compile_ok; then
9604 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9607 echo "Your $zzz is $fpossize bytes long."
9613 echo "(I can't compile the test program. Guessing...)" >&4
9614 rp="What is the size of your file positions (in bytes)?"
9619 : Check for large file support
9620 # Backward compatibility (uselfs is deprecated).
9622 "$define"|true|[yY]*)
9625 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9627 uselargefiles="$define"
9631 case "$lseeksize:$fpossize" in
9634 You can have files larger than 2 gigabytes.
9637 *) case "$uselargefiles" in
9638 "$undef"|false|[nN]*) dflt='n' ;;
9643 Perl can be built to understand large files (files larger than 2 gigabytes)
9644 on some systems. To do so, Configure can be run with -Duselargefiles.
9646 If this doesn't make any sense to you, just accept the default '$dflt'.
9648 rp='Try to understand large files, if available?'
9651 y|Y) val="$define" ;;
9658 : Look for a hint-file generated 'call-back-unit'. If the
9659 : user has specified that a large files perl is to be built,
9660 : we may need to set or change some other defaults.
9661 if $test -f uselargefiles.cbu; then
9662 echo "Your platform has some specific hints regarding large file builds, using them..."
9663 . ./uselargefiles.cbu
9665 case "$uselargefiles" in
9667 if $test -f uselargefiles.cbu; then
9669 echo "Rechecking to see how big your file offsets are..." >&4
9671 #include <sys/types.h>
9675 printf("%d\n", (int)sizeof($lseektype));
9680 if eval $compile_ok; then
9681 lseeksize=`$run ./try`
9682 $echo "Your file offsets are now $lseeksize bytes long."
9686 echo "(I can't seem to compile the test program. Guessing...)"
9687 rp="What is the size of your file offsets (in bytes)?"
9692 *_t) zzz="$fpostype" ;;
9695 $echo $n "Rechecking the size of $zzz...$c" >&4
9697 #include <sys/types.h>
9704 printf("%d\n", (int)sizeof($fpostype));
9709 if eval $compile_ok; then
9714 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9717 echo " $fpossize bytes." >&4
9723 echo "(I can't compile the test program. Guessing...)" >&4
9724 rp="What is the size of your file positions (in bytes)?"
9733 : Check if we want perlio
9736 : Set the vendorbin variables
9737 case "$vendorprefix" in
9738 '') d_vendorbin="$undef"
9742 *) d_vendorbin="$define"
9743 : determine where vendor-supplied executables go.
9744 case "$vendorbin" in
9745 '') dflt=$vendorprefix/bin ;;
9746 *) dflt="$vendorbin" ;;
9749 rp='Pathname for the vendor-supplied executables directory?'
9752 vendorbinexp="$ansexp"
9758 : Set the vendorhtml1dir variables
9759 case "$vendorprefix" in
9760 '') vendorhtml1dir=''
9761 vendorhtml1direxp=''
9763 *) : determine where vendor-supplied html pages go.
9764 : There is no standard location, so try to copy the previously-selected
9765 : directory structure for the core html pages.
9766 : XXX Better default suggestions would be welcome.
9767 case "$vendorhtml1dir" in
9768 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9769 *) dflt=$vendorhtml1dir ;;
9772 ''|' ') dflt=none ;;
9775 rp='Pathname for the vendor-supplied html pages?'
9777 vendorhtml1dir="$ans"
9778 vendorhtml1direxp="$ansexp"
9781 : Use ' ' for none so value is preserved next time through Configure
9782 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9783 prefixvar=vendorhtml1dir
9786 : Set the vendorhtml3dir variables
9787 case "$vendorprefix" in
9788 '') vendorhtml3dir=''
9789 vendorhtml3direxp=''
9791 *) : determine where vendor-supplied module html pages go.
9792 : There is no standard location, so try to copy the previously-selected
9793 : directory structure for the core html pages.
9794 : XXX Better default suggestions would be welcome.
9795 case "$vendorhtml3dir" in
9796 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9797 *) dflt=$vendorhtml3dir ;;
9800 ''|' ') dflt=none ;;
9803 rp='Pathname for the vendor-supplied html pages?'
9805 vendorhtml3dir="$ans"
9806 vendorhtml3direxp="$ansexp"
9809 : Use ' ' for none so value is preserved next time through Configure
9810 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9811 prefixvar=vendorhtml3dir
9814 : Set the vendorman1dir variables
9815 case "$vendorprefix" in
9816 '') vendorman1dir=''
9819 *) : determine where vendor-supplied manual pages go.
9820 case "$vendorman1dir" in
9821 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9822 *) dflt=$vendorman1dir ;;
9825 ''|' ') dflt=none ;;
9828 rp='Pathname for the vendor-supplied manual section 1 pages?'
9830 vendorman1dir="$ans"
9831 vendorman1direxp="$ansexp"
9834 : Use ' ' for none so value is preserved next time through Configure
9835 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9836 prefixvar=vendorman1dir
9839 : Set the vendorman3dir variables
9840 case "$vendorprefix" in
9841 '') vendorman3dir=''
9844 *) : determine where vendor-supplied module manual pages go.
9845 case "$vendorman3dir" in
9846 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9847 *) dflt=$vendorman3dir ;;
9850 ''|' ') dflt=none ;;
9853 rp='Pathname for the vendor-supplied manual section 3 pages?'
9855 vendorman3dir="$ans"
9856 vendorman3direxp="$ansexp"
9859 : Use ' ' for none so value is preserved next time through Configure
9860 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9861 prefixvar=vendorman3dir
9864 : Set the vendorscript variables
9865 case "$vendorprefix" in
9866 '') d_vendorscript="$undef"
9870 *) d_vendorscript="$define"
9871 : determine where vendor-supplied scripts go.
9872 case "$vendorscript" in
9873 '') dflt=$vendorprefix/script
9874 $test -d $dflt || dflt=$vendorbin ;;
9875 *) dflt="$vendorscript" ;;
9879 The installation process will create a directory for
9880 vendor-supplied scripts.
9884 rp='Pathname for the vendor-supplied scripts directory?'
9887 vendorscriptexp="$ansexp"
9890 prefixvar=vendorscript
9893 : script used to emit important warnings
9896 if test \$# -gt 0; then
9901 echo "*** WARNING:" >&4
9902 sed -e 's/^/*** /' <msg >&4
9904 cat msg >>config.msg
9905 echo " " >>config.msg
9911 : see which of string.h or strings.h is needed
9913 strings=`./findhdr string.h`
9914 if $test "$strings" && $test -r "$strings"; then
9915 echo "Using <string.h> instead of <strings.h>." >&4
9919 strings=`./findhdr strings.h`
9920 if $test "$strings" && $test -r "$strings"; then
9921 echo "Using <strings.h> instead of <string.h>." >&4
9923 ./warn "No string header found -- You'll surely have problems."
9929 "$undef") strings=`./findhdr strings.h`;;
9930 *) strings=`./findhdr string.h`;;
9933 : see if qgcvt exists
9937 : Check print/scan long double stuff
9940 if $test X"$d_longdbl" = X"$define"; then
9942 echo "Checking how to print long doubles..." >&4
9944 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9945 $cat >try.c <<'EOCP'
9946 #include <sys/types.h>
9950 printf("%.3f\n", d);
9954 if eval $compile; then
9958 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9959 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9960 echo "We will use %f."
9966 if $test X"$sPRIfldbl" = X; then
9967 $cat >try.c <<'EOCP'
9968 #include <sys/types.h>
9971 long double d = 123.456;
9972 printf("%.3Lf\n", d);
9976 if eval $compile; then
9980 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9981 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9982 echo "We will use %Lf."
9988 if $test X"$sPRIfldbl" = X; then
9989 $cat >try.c <<'EOCP'
9990 #include <sys/types.h>
9993 long double d = 123.456;
9994 printf("%.3llf\n", d);
9998 if eval $compile; then
10002 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10003 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10004 echo "We will use %llf."
10010 if $test X"$sPRIfldbl" = X; then
10011 $cat >try.c <<'EOCP'
10012 #include <sys/types.h>
10015 long double d = 123.456;
10016 printf("%.3lf\n", d);
10020 if eval $compile; then
10024 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10025 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10026 echo "We will use %lf."
10032 if $test X"$sPRIfldbl" = X; then
10033 echo "Cannot figure out how to print long doubles." >&4
10035 sSCNfldbl=$sPRIfldbl # expect consistency
10042 case "$sPRIfldbl" in
10043 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10044 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10045 d_SCNfldbl="$undef";
10047 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10048 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10049 d_SCNfldbl="$define";
10053 : Check how to convert floats to strings.
10055 if test "X$d_Gconvert" = X; then
10058 echo "Checking for an efficient way to convert floats to strings."
10060 case "$uselongdouble" in
10061 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10063 case "$d_longdbl" in
10064 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10066 case "$d_PRIgldbl" in
10067 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10070 #ifdef TRY_gconvert
10071 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10072 char *myname = "gconvert";
10075 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10076 char *myname = "gcvt";
10079 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10080 char *myname = "qgcvt";
10081 #define DOUBLETYPE long double
10084 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10085 #ifdef HAS_PRIgldbl
10086 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10088 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10091 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10093 char *myname = "sprintf";
10097 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10098 #define DOUBLETYPE long double
10100 #define DOUBLETYPE double
10106 #$i_stdlib I_STDLIB
10108 #include <stdlib.h>
10110 #$i_string I_STRING
10112 # include <string.h>
10114 # include <strings.h>
10117 int checkit(char *expect, char *got)
10119 if (strcmp(expect, got)) {
10120 printf("%s oddity: Expected %s, got %s\n",
10121 myname, expect, got);
10131 /* This must be 1st test on (which?) platform */
10132 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10133 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10134 checkit("0.1", buf);
10136 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10137 checkit("0.01", buf);
10139 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10140 checkit("0.001", buf);
10142 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10143 checkit("0.0001", buf);
10145 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10146 if (strlen(buf) > 5)
10147 checkit("9e-005", buf); /* for Microsoft ?? */
10149 checkit("9e-05", buf);
10151 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10154 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10155 checkit("1.1", buf);
10157 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10158 checkit("1.01", buf);
10160 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10161 checkit("1.001", buf);
10163 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10164 checkit("1.0001", buf);
10166 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10167 checkit("1.00001", buf);
10169 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10170 checkit("1.000001", buf);
10172 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10175 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10176 checkit("-1", buf);
10178 /* Some Linux gcvt's give 1.e+5 here. */
10179 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10180 checkit("100000", buf);
10182 /* Some Linux gcvt's give -1.e+5 here. */
10183 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10184 checkit("-100000", buf);
10186 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10187 checkit("123.456", buf);
10189 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10190 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10191 /* 34 should be enough to scare even long double
10192 * places into using the e notation. */
10193 if (strlen(buf) > 5)
10194 checkit("1e+034", buf); /* for Microsoft */
10196 checkit("1e+34", buf);
10198 /* For Perl, if you add additional tests here, also add them to
10199 * t/base/num.t for benefit of platforms not using Configure or
10200 * overriding d_Gconvert */
10205 : first add preferred functions to our list
10207 for xxx_convert in $gconvert_preference; do
10208 case $xxx_convert in
10209 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10210 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10213 : then add any others
10214 for xxx_convert in gconvert gcvt sprintf; do
10215 case "$xxx_list" in
10217 *) xxx_list="$xxx_list $xxx_convert" ;;
10221 case "$d_longdbl$uselongdouble" in
10223 : again, add preferred functions to our list first
10225 for xxx_convert in $gconvert_ld_preference; do
10226 case $xxx_convert in
10227 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10228 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10231 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10232 for xxx_convert in qgcvt sprintf $xxx_list; do
10233 case "$xxx_ld_list" in
10234 $xxx_convert*|*" $xxx_convert"*) ;;
10235 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10238 : if sprintf cannot do long doubles, move it to the end
10239 if test "$d_PRIgldbl" != "$define"; then
10240 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10242 : if no qgcvt, remove it
10243 if test "$d_qgcvt" != "$define"; then
10244 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10247 xxx_list="$xxx_ld_list"
10251 for xxx_convert in $xxx_list; do
10252 echo "Trying $xxx_convert..."
10253 $rm -f try try$_o core
10254 set try -DTRY_$xxx_convert
10255 if eval $compile; then
10256 echo "$xxx_convert() found." >&4
10257 if $run ./try; then
10258 echo "I'll use $xxx_convert to convert floats into a string." >&4
10261 echo "...But $xxx_convert didn't work as I expected."
10265 echo "$xxx_convert NOT found." >&4
10269 if test X$xxx_convert = X; then
10270 echo "*** WHOA THERE!!! ***" >&4
10271 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10272 xxx_convert=sprintf
10275 case "$xxx_convert" in
10276 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10277 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10278 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10279 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10280 "$define$define$define")
10281 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10282 "$define$define$undef")
10283 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10284 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10292 : see if _fwalk exists
10296 : Initialize h_fcntl
10299 : Initialize h_sysfile
10302 : access call always available on UNIX
10303 set access d_access
10306 : locate the flags for 'access()'
10307 case "$d_access" in
10310 $cat >access.c <<EOCP
10311 #include <sys/types.h>
10316 #include <sys/file.h>
10319 #include <unistd.h>
10321 #$i_stdlib I_STDLIB
10323 #include <stdlib.h>
10329 : check sys/file.h first, no particular reason here
10330 if $test `./findhdr sys/file.h` && \
10331 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10333 echo "<sys/file.h> defines the *_OK access constants." >&4
10334 elif $test `./findhdr fcntl.h` && \
10335 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10337 echo "<fcntl.h> defines the *_OK access constants." >&4
10338 elif $test `./findhdr unistd.h` && \
10339 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10340 echo "<unistd.h> defines the *_OK access constants." >&4
10342 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10348 : see if accessx exists
10349 set accessx d_accessx
10352 : see if acosh exists
10356 : see if aintl exists
10360 : see if alarm exists
10364 : see if 64bit time functions exists
10366 set ctime64 d_ctime64
10369 set localtime64 d_localtime64
10372 set gmtime64 d_gmtime64
10375 set mktime64 d_mktime64
10378 set difftime64 d_difftime64
10381 set asctime64 d_asctime64
10384 : see if POSIX threads are available
10385 set pthread.h i_pthread
10388 : define a function to check prototypes
10389 $cat > protochk <<EOSH
10392 optimize="$optimize"
10394 prototype="$prototype"
10397 usethreads=$usethreads
10398 i_pthread=$i_pthread
10399 pthread_h_first=$pthread_h_first
10402 $cat >> protochk <<'EOSH'
10407 while test $# -ge 2; do
10409 $define) echo "#include <$2>" >> try.c ;;
10410 literal) echo "$2" >> try.c ;;
10412 # Extra magic for the benefit of systems that need pthread.h
10413 # to be included early to correctly detect threadsafe functions.
10414 # Such functions must guarantee themselves, though, that the usethreads
10415 # and i_pthread have been defined, before calling protochk.
10416 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10417 echo "#include <pthread.h>" >> try.c
10422 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10423 cat >> try.c <<'EOCP'
10424 #ifdef CAN_PROTOTYPE
10425 #define _(args) args
10430 echo "$foo" >> try.c
10431 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10432 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10438 $eunicefix protochk
10440 : Define hasproto macro for Configure internal use
10441 hasproto='varname=$1; func=$2; shift; shift;
10442 while $test $# -ge 2; do
10444 $define) echo "#include <$2>";;
10448 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10449 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10450 echo "$func() prototype found.";
10453 echo "$func() prototype NOT found.";
10460 : see if sys/types.h has to be included
10461 set sys/types.h i_systypes
10464 : see if sys/select.h has to be included
10465 set sys/select.h i_sysselct
10468 : Define hasfield macro for Configure internal use
10469 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10470 while $test $# -ge 2; do
10472 $define) echo "#include <$2>";;
10476 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10478 if eval $compile; then
10487 : see if we should include time.h, sys/time.h, or both
10489 if test "X$timeincl" = X; then
10490 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10491 $echo $n "I'm now running the test program...$c"
10493 #include <sys/types.h>
10498 #ifdef SYSTIMEKERNEL
10501 #include <sys/time.h>
10504 #include <sys/select.h>
10506 #$i_stdlib I_STDLIB
10508 #include <stdlib.h>
10514 struct timeval bar;
10517 struct timezone tzp;
10519 if (foo.tm_sec == foo.tm_sec)
10522 if (bar.tv_sec == bar.tv_sec)
10529 for s_timezone in '-DS_TIMEZONE' ''; do
10531 for s_timeval in '-DS_TIMEVAL' ''; do
10532 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10533 for i_time in '' '-DI_TIME'; do
10534 for i_systime in '-DI_SYSTIME' ''; do
10537 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10538 if eval $compile; then
10539 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10543 $echo $n "Succeeded with $flags$c"
10555 *SYSTIMEKERNEL*) i_systimek="$define"
10556 timeincl=`./findhdr sys/time.h`
10557 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10558 *) i_systimek="$undef";;
10561 *I_TIME*) i_time="$define"
10562 timeincl=`./findhdr time.h`" $timeincl"
10563 echo "We'll include <time.h>." >&4;;
10564 *) i_time="$undef";;
10567 *I_SYSTIME*) i_systime="$define"
10568 timeincl=`./findhdr sys/time.h`" $timeincl"
10569 echo "We'll include <sys/time.h>." >&4;;
10570 *) i_systime="$undef";;
10574 : see if struct tm knows about tm_zone
10575 case "$i_systime$i_time" in
10578 echo "Checking to see if your struct tm has tm_zone field..." >&4
10579 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10587 case "$d_tm_tm_zone" in
10588 "$define") echo "Yes, it does." ;;
10589 *) echo "No, it doesn't." ;;
10591 : see if struct tm knows about tm_gmtoff
10592 case "$i_systime$i_time" in
10595 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10596 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10604 case "$d_tm_tm_gmtoff" in
10605 "$define") echo "Yes, it does." ;;
10606 *) echo "No, it doesn't." ;;
10609 : see if asctime_r exists
10610 set asctime_r d_asctime_r
10612 case "$d_asctime_r" in
10614 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10615 case "$d_asctime_r_proto:$usethreads" in
10616 ":define") d_asctime_r_proto=define
10617 set d_asctime_r_proto asctime_r $hdrs
10621 case "$d_asctime_r_proto" in
10623 case "$asctime_r_proto" in
10624 ''|0) try='char* asctime_r(const struct tm*, char*);'
10625 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10627 case "$asctime_r_proto" in
10628 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10629 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10631 case "$asctime_r_proto" in
10632 ''|0) try='int asctime_r(const struct tm*, char*);'
10633 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10635 case "$asctime_r_proto" in
10636 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10637 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10639 case "$asctime_r_proto" in
10640 ''|0) d_asctime_r=undef
10642 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10643 * ) case "$asctime_r_proto" in
10644 REENTRANT_PROTO*) ;;
10645 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10647 echo "Prototype: $try" ;;
10650 *) case "$usethreads" in
10651 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10658 *) asctime_r_proto=0
10662 : see if atolf exists
10666 : see if atoll exists
10670 : Look for GCC-style attribute format
10671 case "$d_attribute_format" in
10674 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10675 $cat >attrib.c <<'EOCP'
10677 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10679 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10680 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10681 echo "Your C compiler doesn't support __attribute__((format))."
10684 echo "Your C compiler supports __attribute__((format))."
10688 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10692 *) val="$d_attribute_format" ;;
10694 set d_attribute_format
10698 : Look for GCC-style attribute format with null format allowed
10699 case "$d_printf_format_null" in
10700 '') case "$d_attribute_format" in
10703 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10704 $cat >attrib.c <<EOCP
10706 #$i_stdlib I_STDLIB
10708 #include <stdlib.h>
10710 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10711 int null_printf (char* pat,...) { return (int)pat; }
10712 int main () { exit(null_printf(NULL)); }
10714 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10715 : run the executable in case it produces a run-time warning
10716 if $run ./attrib >>attrib.out 2>&1; then
10717 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10718 echo "Your C compiler doesn't allow __printf__ format to be null."
10721 echo "Your C compiler allows __printf__ format to be null."
10725 echo "Your C compiler executable failed with __printf__ format null."
10729 echo "Your C compiler fails with __printf__ format null."
10736 *) val="$d_printf_format_null" ;;
10738 set d_printf_format_null
10742 : Look for GCC-style attribute malloc
10743 case "$d_attribute_malloc" in
10746 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10747 $cat >attrib.c <<'EOCP'
10749 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10751 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10752 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10753 echo "Your C compiler doesn't support __attribute__((malloc))."
10756 echo "Your C compiler supports __attribute__((malloc))."
10760 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10764 *) val="$d_attribute_malloc" ;;
10766 set d_attribute_malloc
10770 : Look for GCC-style attribute nonnull
10771 case "$d_attribute_nonnull" in
10774 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10775 $cat >attrib.c <<'EOCP'
10777 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10779 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10780 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10781 echo "Your C compiler doesn't support __attribute__((nonnull))."
10784 echo "Your C compiler supports __attribute__((nonnull))."
10788 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10792 *) val="$d_attribute_nonnull" ;;
10794 set d_attribute_nonnull
10798 : Look for GCC-style attribute noreturn
10799 case "$d_attribute_noreturn" in
10802 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10803 $cat >attrib.c <<'EOCP'
10805 void fall_over_dead( void ) __attribute__((noreturn));
10807 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10808 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10809 echo "Your C compiler doesn't support __attribute__((noreturn))."
10812 echo "Your C compiler supports __attribute__((noreturn))."
10816 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10820 *) val="$d_attribute_noreturn" ;;
10822 set d_attribute_noreturn
10826 : Look for GCC-style attribute pure
10827 case "$d_attribute_pure" in
10830 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10831 $cat >attrib.c <<'EOCP'
10833 int square( int n ) __attribute__((pure));
10835 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10836 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10837 echo "Your C compiler doesn't support __attribute__((pure))."
10840 echo "Your C compiler supports __attribute__((pure))."
10844 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10848 *) val="$d_attribute_pure" ;;
10850 set d_attribute_pure
10854 : Look for GCC-style attribute unused
10855 case "$d_attribute_unused" in
10858 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10859 $cat >attrib.c <<'EOCP'
10861 int do_something( int dummy __attribute__((unused)), int n );
10863 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10864 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10865 echo "Your C compiler doesn't support __attribute__((unused))."
10868 echo "Your C compiler supports __attribute__((unused))."
10872 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10876 *) val="$d_attribute_unused" ;;
10878 set d_attribute_unused
10882 : Look for GCC-style attribute deprecated
10883 case "$d_attribute_deprecated" in
10886 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10887 $cat >attrib.c <<'EOCP'
10889 int I_am_deprecated(void) __attribute__((deprecated));
10891 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10892 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10893 echo "Your C compiler doesn't support __attribute__((deprecated))."
10896 echo "Your C compiler supports __attribute__((deprecated))."
10900 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10904 *) val="$d_attribute_deprecated" ;;
10906 set d_attribute_deprecated
10910 : Look for GCC-style attribute warn_unused_result
10911 case "$d_attribute_warn_unused_result" in
10914 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10915 $cat >attrib.c <<'EOCP'
10917 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10919 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10920 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10921 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10924 echo "Your C compiler supports __attribute__((warn_unused_result))."
10928 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10932 *) val="$d_attribute_warn_unused_result" ;;
10934 set d_attribute_warn_unused_result
10938 : see if bcmp exists
10942 : see if bcopy exists
10946 : see if getpgrp exists
10947 set getpgrp d_getpgrp
10950 case "$d_getpgrp" in
10953 echo "Checking to see which flavor of getpgrp is in use..."
10955 #$i_unistd I_UNISTD
10956 #include <sys/types.h>
10958 # include <unistd.h>
10960 #$i_stdlib I_STDLIB
10962 #include <stdlib.h>
10966 if (getuid() == 0) {
10967 printf("(I see you are running Configure as super-user...)\n");
10970 #ifdef TRY_BSD_PGRP
10971 if (getpgrp(1) == 0)
10980 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10981 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10983 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10984 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10987 echo "I can't seem to compile and run the test program."
10989 xxx="a USG one, i.e. you use getpgrp()."
10991 # SVR4 systems can appear rather BSD-ish.
10992 case "$i_unistd" in
10994 xxx="a BSD one, i.e. you use getpgrp(pid)."
10998 xxx="probably a USG one, i.e. you use getpgrp()."
11003 echo "Assuming your getpgrp is $xxx" >&4
11012 : see if setpgrp exists
11013 set setpgrp d_setpgrp
11016 case "$d_setpgrp" in
11019 echo "Checking to see which flavor of setpgrp is in use..."
11021 #$i_unistd I_UNISTD
11022 #include <sys/types.h>
11024 # include <unistd.h>
11026 #$i_stdlib I_STDLIB
11028 #include <stdlib.h>
11032 if (getuid() == 0) {
11033 printf("(I see you are running Configure as super-user...)\n");
11036 #ifdef TRY_BSD_PGRP
11037 if (-1 == setpgrp(1, 1))
11040 if (setpgrp() != -1)
11046 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11047 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11049 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11050 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11053 echo "(I can't seem to compile and run the test program.)"
11055 xxx="a USG one, i.e. you use setpgrp()."
11057 # SVR4 systems can appear rather BSD-ish.
11058 case "$i_unistd" in
11060 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11064 xxx="probably a USG one, i.e. you use setpgrp()."
11069 echo "Assuming your setpgrp is $xxx" >&4
11078 : Look for GCC-style __builtin_choose_expr
11079 case "$d_builtin_choose_expr" in
11082 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11083 $cat >try.c <<'EOCP'
11084 #include <assert.h>
11085 #include <stdlib.h>
11088 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11091 assert( SYRINX(1) == 2112 );
11092 assert( SYRINX(1) != 5150 );
11093 assert( SYRINX(0) == 5150 );
11094 assert( SYRINX(0) != 2112 );
11095 puts( "All good!" );
11101 if eval $compile && $run ./try; then
11102 echo "Your C compiler supports __builtin_choose_expr."
11105 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11109 *) val="$d_builtin_choose_expr" ;;
11112 set d_builtin_choose_expr
11116 : Look for GCC-style __builtin_expect
11117 case "$d_builtin_expect" in
11120 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11121 $cat >try.c <<'EOCP'
11124 if ( __builtin_expect(n, 0) ) n = 1;
11125 /* Remember shell exit code truth is 0, C truth is non-zero */
11130 if eval $compile && $run ./try; then
11131 echo "Your C compiler supports __builtin_expect."
11134 echo "Your C compiler doesn't seem to understand __builtin_expect."
11138 *) val="$d_builtin_expect" ;;
11141 set d_builtin_expect
11145 : see if bzero exists
11149 : see if stdarg is available
11151 if $test `./findhdr stdarg.h`; then
11152 echo "<stdarg.h> found." >&4
11155 echo "<stdarg.h> NOT found." >&4
11159 : see if varargs is available
11161 if $test `./findhdr varargs.h`; then
11162 echo "<varargs.h> found." >&4
11164 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11167 : set up the varargs testing programs
11168 $cat > varargs.c <<EOP
11170 #include <stdarg.h>
11173 #include <varargs.h>
11177 int f(char *p, ...)
11191 p = va_arg(ap, char *);
11197 $cat > varargs <<EOP
11199 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11208 : now check which varargs header should be included
11214 if `./varargs I_STDARG`; then
11216 elif `./varargs I_VARARGS`; then
11221 if `./varargs I_VARARGS`; then
11229 echo "*** WHOA THERE!!! ***" >&4
11230 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11231 case "$knowitall" in
11233 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11237 echo "I could not find the definition for va_dcl... You have problems..." >&4
11238 val="$undef"; set i_stdarg; eval $setvar
11239 val="$undef"; set i_varargs; eval $setvar
11244 case "$i_varhdr" in
11246 val="$define"; set i_stdarg; eval $setvar
11247 val="$undef"; set i_varargs; eval $setvar
11250 val="$undef"; set i_stdarg; eval $setvar
11251 val="$define"; set i_varargs; eval $setvar
11254 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11258 : see if the Compiler supports C99 variadic macros
11259 case "$i_stdarg$i_stdlib" in
11261 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11264 #include <stdarg.h>
11266 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11270 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11276 if eval $compile && $run ./try 2>&1 >/dev/null; then
11277 case "`$run ./try`" in
11279 echo "You have C99 variadic macros." >&4
11280 d_c99_variadic_macros="$define"
11283 echo "You don't have functional C99 variadic macros." >&4
11284 d_c99_variadic_macros="$undef"
11288 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11289 d_c99_variadic_macros="$undef"
11294 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11295 d_c99_variadic_macros="$undef"
11299 : see if signal is declared as pointer to function returning int or void
11301 xxx=`./findhdr signal.h`
11302 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11303 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11304 echo "You have int (*signal())() instead of void." >&4
11306 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11307 echo "You have void (*signal())()." >&4
11309 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11310 echo "You have int (*signal())() instead of void." >&4
11312 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11313 echo "You have void (*signal())()." >&4
11316 case "$d_voidsig" in
11318 echo "I can't determine whether signal handler returns void or int..." >&4
11320 rp="What type does your signal handler return?"
11323 v*) val="$define";;
11327 echo "As you already told me, signal handler returns void." >&4
11330 *) echo "As you already told me, signal handler returns int." >&4
11337 case "$d_voidsig" in
11338 "$define") signal_t="void";;
11339 *) signal_t="int";;
11343 : check for ability to cast large floats to 32-bit ints.
11345 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11346 if $test "$intsize" -ge 4; then
11353 #$i_stdlib I_STDLIB
11355 #include <stdlib.h>
11357 #include <sys/types.h>
11358 #include <signal.h>
11359 $signal_t blech(int s) { exit(3); }
11366 signal(SIGFPE, blech);
11368 /* Don't let compiler optimize the test away. Store the number
11369 in a writable string for gcc to pass to sscanf under HP-UX.
11371 sprintf(str, "2147483647");
11372 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11376 /* x86 processors will probably give 0x8000 0000, which is a
11377 sign change. We don't want that. We want to mimic SPARC
11378 behavior here, which is to preserve the sign and give
11381 if (i32 != ($xxx) f)
11387 if eval $compile_ok; then
11391 echo "(I can't seem to compile the test program--assuming it can't)"
11396 echo "Yup, it can."
11399 echo "Nope, it can't."
11406 : check for ability to cast negative floats to unsigned
11408 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11411 #$i_stdlib I_STDLIB
11413 #include <stdlib.h>
11415 #include <sys/types.h>
11416 #include <signal.h>
11417 $signal_t blech(int s) { exit(7); }
11418 $signal_t blech_in_list(int s) { exit(4); }
11419 unsigned long dummy_long(unsigned long p) { return p; }
11420 unsigned int dummy_int(unsigned int p) { return p; }
11421 unsigned short dummy_short(unsigned short p) { return p; }
11425 unsigned long along;
11427 unsigned short ashort;
11431 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11432 a direct f = -123. assignment. gcc-2.8.0 reportedly
11433 optimized the whole file away
11435 /* Store the number in a writable string for gcc to pass to
11436 sscanf under HP-UX.
11438 sprintf(str, "-123");
11439 sscanf(str, "%lf", &f); /* f = -123.; */
11441 signal(SIGFPE, blech);
11442 along = (unsigned long)f;
11443 aint = (unsigned int)f;
11444 ashort = (unsigned short)f;
11445 if (along != (unsigned long)-123)
11447 if (aint != (unsigned int)-123)
11449 if (ashort != (unsigned short)-123)
11451 sprintf(str, "1073741824.");
11452 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11455 along = (unsigned long)f;
11456 if (along != 0x80000000)
11460 along = (unsigned long)f;
11461 if (along != 0x7fffffff)
11465 along = (unsigned long)f;
11466 if (along != 0x80000001)
11470 signal(SIGFPE, blech_in_list);
11471 sprintf(str, "123.");
11472 sscanf(str, "%lf", &f); /* f = 123.; */
11473 along = dummy_long((unsigned long)f);
11474 aint = dummy_int((unsigned int)f);
11475 ashort = dummy_short((unsigned short)f);
11476 if (along != (unsigned long)123)
11478 if (aint != (unsigned int)123)
11480 if (ashort != (unsigned short)123)
11487 if eval $compile_ok; then
11491 echo "(I can't seem to compile the test program--assuming it can't)"
11494 case "$castflags" in
11496 echo "Yup, it can."
11499 echo "Nope, it can't."
11506 : see if vprintf exists
11508 if set vprintf val -f d_vprintf; eval $csym; $val; then
11509 echo 'vprintf() found.' >&4
11512 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11513 #$i_varargs I_VARARGS
11515 #$i_stdlib I_STDLIB
11516 #$i_unistd I_UNISTD
11519 # include <stdarg.h>
11520 #else /* I_VARARGS */
11521 # include <varargs.h>
11525 # include <unistd.h>
11529 # include <stdlib.h>
11532 #include <stdio.h> /* vsprintf prototype */
11535 void xxx(int n, ...)
11540 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11542 int main() { xxx(1, "foo"); }
11544 #else /* I_VARARGS */
11552 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11554 int main() { xxx("foo"); }
11560 if eval $compile_ok; then
11561 if $run ./try; then
11562 echo "Your vsprintf() returns (int)." >&4
11565 echo "Your vsprintf() returns (char*)." >&4
11569 echo 'I am unable to compile the vsprintf() test program.' >&4
11570 # We shouldn't get here. If we do, assume the standard signature,
11571 # not the old BSD one.
11572 echo 'Guessing that vsprintf() returns (int).' >&4
11576 echo 'vprintf() NOT found.' >&4
11587 : see if chown exists
11591 : see if chroot exists
11592 set chroot d_chroot
11595 : see if chsize exists
11596 set chsize d_chsize
11599 : see if class exists
11603 : see if clearenv exists
11604 set clearenv d_clearenv
11607 : Define hasstruct macro for Configure internal use
11608 hasstruct='varname=$1; struct=$2; shift; shift;
11609 while $test $# -ge 2; do
11611 $define) echo "#include <$2>";;
11615 echo "int main () { struct $struct foo; }" >> try.c;
11617 if eval $compile; then
11626 : see whether socket exists
11630 $echo $n "Hmm... $c" >&4
11631 if set socket val -f d_socket; eval $csym; $val; then
11632 echo "Looks like you have Berkeley networking support." >&4
11634 if set setsockopt val -f; eval $csym; $val; then
11637 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11638 d_oldsock="$define"
11641 if $contains socklib libc.list >/dev/null 2>&1; then
11642 echo "Looks like you have Berkeley networking support." >&4
11644 : we will have to assume that it supports the 4.2 BSD interface
11647 echo "You don't have Berkeley networking in libc$_a..." >&4
11648 if test "X$d_socket" = "X$define"; then
11649 echo "...but you seem to believe that you have sockets." >&4
11651 for net in net socket
11653 if test -f $sysroot/usr/lib/lib$net$_a; then
11654 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11655 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11656 if $contains socket libc.list >/dev/null 2>&1; then
11661 echo "...but the Wollongong group seems to have hacked it in." >&4
11662 sockethdr="-I$sysroot/usr/netinclude"
11665 echo "Found Berkeley sockets interface in lib$net." >&4
11666 if $contains setsockopt libc.list >/dev/null 2>&1; then
11669 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11670 d_oldsock="$define"
11676 if test "X$d_socket" != "X$define"; then
11677 echo "or anywhere else I see." >&4
11685 : see if socketpair exists
11686 set socketpair d_sockpair
11691 echo "Checking the availability sa_len in the sock struct ..." >&4
11693 #include <sys/types.h>
11694 #include <sys/socket.h>
11696 struct sockaddr sa;
11697 return (sa.sa_len);
11701 set try; if eval $compile; then
11704 set d_sockaddr_sa_len; eval $setvar
11708 echo "Checking the availability struct sockaddr_in6 ..." >&4
11710 #include <sys/types.h>
11711 #include <sys/socket.h>
11712 #include <netinet/in.h>
11714 struct sockaddr_in6 sin6;
11715 return (sin6.sin6_family);
11719 set try; if eval $compile; then
11722 set d_sockaddr_in6; eval $setvar
11726 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11728 #include <sys/types.h>
11729 #include <sys/socket.h>
11730 #include <netinet/in.h>
11732 struct sockaddr_in6 sin6;
11733 return (sin6.sin6_scope_id);
11737 set try; if eval $compile; then
11740 set d_sin6_scope_id; eval $setvar
11744 echo "Checking the availability struct ip_mreq ..." >&4
11746 #include <sys/types.h>
11747 #include <sys/socket.h>
11748 #include <netinet/in.h>
11750 struct ip_mreq mreq;
11751 return (mreq.imr_multiaddr.s_addr);
11755 set try; if eval $compile; then
11758 set d_ip_mreq; eval $setvar
11762 echo "Checking the availability struct ip_mreq_source ..." >&4
11764 #include <sys/types.h>
11765 #include <sys/socket.h>
11766 #include <netinet/in.h>
11768 struct ip_mreq_source mreq;
11769 return (mreq.imr_multiaddr.s_addr);
11773 set try; if eval $compile; then
11776 set d_ip_mreq_source; eval $setvar
11780 echo "Checking the availability struct ipv6_mreq ..." >&4
11782 #include <sys/types.h>
11783 #include <sys/socket.h>
11784 #include <netinet/in.h>
11786 struct ipv6_mreq mreq;
11787 return (mreq.ipv6mr_interface);
11791 set try; if eval $compile; then
11794 set d_ipv6_mreq; eval $setvar
11798 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11800 #include <sys/types.h>
11801 #include <sys/socket.h>
11802 #include <netinet/in.h>
11804 struct ipv6_mreq_source mreq;
11805 return (mreq.imr_multiaddr.s_addr);
11809 set try; if eval $compile; then
11812 set d_ipv6_mreq_source; eval $setvar
11816 echo "Checking the availability of certain socket constants..." >&4
11817 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11818 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11820 #include <sys/types.h>
11821 #include <sys/socket.h>
11827 set try; if eval $compile; then
11830 set d_${enum}; eval $setvar
11834 : see if this is a sys/uio.h system
11835 set sys/uio.h i_sysuio
11838 : Check for cmsghdr support
11840 echo "Checking to see if your system supports struct cmsghdr..." >&4
11841 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11843 case "$d_cmsghdr_s" in
11844 "$define") echo "Yes, it does." ;;
11845 *) echo "No, it doesn't." ;;
11849 : check for const keyword
11851 echo 'Checking to see if your C compiler knows about "const"...' >&4
11852 $cat >const.c <<'EOCP'
11853 typedef struct spug { int drokk; } spug;
11857 const spug y = { 0 };
11860 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11862 echo "Yup, it does."
11865 echo "Nope, it doesn't."
11870 : see if copysignl exists
11871 set copysignl d_copysignl
11874 : see if crypt exists
11879 $define) cryptlib='' ;;
11880 *) if set crypt val -f d_crypt; eval $csym; $val; then
11881 echo 'crypt() found.' >&4
11885 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11886 if $test -z "$cryptlib"; then
11887 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11891 if $test -z "$cryptlib"; then
11892 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11896 if $test -z "$cryptlib"; then
11897 cryptlib=`./loc libcrypt$_a "" $libpth`
11901 if $test -z "$cryptlib"; then
11902 echo 'crypt() NOT found.' >&4
11913 : see if this is a crypt.h system
11914 set crypt.h i_crypt
11917 : see if crypt_r exists
11918 set crypt_r d_crypt_r
11920 case "$d_crypt_r" in
11922 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11923 case "$d_crypt_r_proto:$usethreads" in
11924 ":define") d_crypt_r_proto=define
11925 set d_crypt_r_proto crypt_r $hdrs
11929 case "$d_crypt_r_proto" in
11931 case "$crypt_r_proto" in
11932 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11933 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11935 case "$crypt_r_proto" in
11936 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11937 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11939 case "$crypt_r_proto" in
11940 ''|0) d_crypt_r=undef
11942 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11943 * ) case "$crypt_r_proto" in
11944 REENTRANT_PROTO*) ;;
11945 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11947 echo "Prototype: $try" ;;
11950 *) case "$usethreads" in
11951 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11962 : get csh whereabouts
11964 'csh') val="$undef" ;;
11965 *) val="$define" ;;
11969 : Respect a hint or command line value for full_csh.
11970 case "$full_csh" in
11971 '') full_csh=$csh ;;
11974 : see if ctermid exists
11975 set ctermid d_ctermid
11978 : see if ctermid_r exists
11979 set ctermid_r d_ctermid_r
11981 case "$d_ctermid_r" in
11983 hdrs="$i_systypes sys/types.h define stdio.h "
11984 case "$d_ctermid_r_proto:$usethreads" in
11985 ":define") d_ctermid_r_proto=define
11986 set d_ctermid_r_proto ctermid_r $hdrs
11990 case "$d_ctermid_r_proto" in
11992 case "$ctermid_r_proto" in
11993 ''|0) try='char* ctermid_r(char*);'
11994 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11996 case "$ctermid_r_proto" in
11997 ''|0) d_ctermid_r=undef
11999 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12000 * ) case "$ctermid_r_proto" in
12001 REENTRANT_PROTO*) ;;
12002 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12004 echo "Prototype: $try" ;;
12007 *) case "$usethreads" in
12008 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12015 *) ctermid_r_proto=0
12019 : see if ctime_r exists
12020 set ctime_r d_ctime_r
12022 case "$d_ctime_r" in
12024 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12025 case "$d_ctime_r_proto:$usethreads" in
12026 ":define") d_ctime_r_proto=define
12027 set d_ctime_r_proto ctime_r $hdrs
12031 case "$d_ctime_r_proto" in
12033 case "$ctime_r_proto" in
12034 ''|0) try='char* ctime_r(const time_t*, char*);'
12035 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12037 case "$ctime_r_proto" in
12038 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12039 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12041 case "$ctime_r_proto" in
12042 ''|0) try='int ctime_r(const time_t*, char*);'
12043 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12045 case "$ctime_r_proto" in
12046 ''|0) try='int ctime_r(const time_t*, char*, int);'
12047 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12049 case "$ctime_r_proto" in
12050 ''|0) d_ctime_r=undef
12052 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12053 * ) case "$ctime_r_proto" in
12054 REENTRANT_PROTO*) ;;
12055 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12057 echo "Prototype: $try" ;;
12060 *) case "$usethreads" in
12061 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12072 : see if cuserid exists
12073 set cuserid d_cuserid
12076 : see if this is a limits.h system
12077 set limits.h i_limits
12080 : See if number of significant digits in a double precision number is known
12082 $cat >dbl_dig.c <<EOM
12083 #$i_limits I_LIMITS
12086 #include <limits.h>
12092 printf("Contains DBL_DIG");
12095 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12096 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12097 echo "DBL_DIG found." >&4
12100 echo "DBL_DIG NOT found." >&4
12107 : see if dbm.h is available
12108 : see if dbmclose exists
12109 set dbmclose d_dbmclose
12112 case "$d_dbmclose" in
12122 *) set rpcsvc/dbm.h i_rpcsvcdbm
12127 *) echo "We won't be including <dbm.h>"
12137 : see if prototype for dbminit is available
12139 set d_dbminitproto dbminit $i_dbm dbm.h
12142 : see if difftime exists
12143 set difftime d_difftime
12146 : see if this is a dirent system
12148 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12150 echo "<dirent.h> found." >&4
12153 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12154 echo "<sys/dir.h> found." >&4
12157 xinc=`./findhdr sys/ndir.h`
12159 echo "<dirent.h> NOT found." >&4
12164 : Look for type of directory structure.
12166 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12168 case "$direntrytype" in
12170 case "$i_dirent" in
12171 $define) guess1='struct dirent' ;;
12172 *) guess1='struct direct' ;;
12175 *) guess1="$direntrytype"
12180 'struct dirent') guess2='struct direct' ;;
12181 *) guess2='struct dirent' ;;
12184 if $contains "$guess1" try.c >/dev/null 2>&1; then
12185 direntrytype="$guess1"
12186 echo "Your directory entries are $direntrytype." >&4
12187 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12188 direntrytype="$guess2"
12189 echo "Your directory entries seem to be $direntrytype." >&4
12191 echo "I don't recognize your system's directory entries." >&4
12192 rp="What type is used for directory entries on this system?"
12195 direntrytype="$ans"
12199 : see if the directory entry stores field length
12201 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12202 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12203 echo "Good, your directory entry keeps length information in d_namlen." >&4
12206 echo "Your directory entry does not know about the d_namlen field." >&4
12213 : Look for DIR.dd_fd
12214 case "$i_dirent" in
12216 echo "Checking to see if DIR has a dd_fd member variable" >&4
12218 #$i_stdlib I_STDLIB
12220 #include <stdlib.h>
12222 #include <dirent.h>
12232 if eval $compile; then
12233 echo "Yes, it does."
12236 echo "No, it does not."
12241 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12249 : see if this is an sysdir system
12250 set sys/dir.h i_sysdir
12253 : see if this is an sysndir system
12254 set sys/ndir.h i_sysndir
12259 $cat >dirfd.c <<EOM
12261 #$i_stdlib I_STDLIB
12263 #include <stdlib.h>
12265 #$i_dirent I_DIRENT /**/
12266 #$i_sysdir I_SYS_DIR /**/
12267 #$i_sysndir I_SYS_NDIR /**/
12268 #$i_systypes I_SYS_TYPES /**/
12269 #if defined(I_SYS_TYPES)
12270 #include <sys/types.h>
12272 #if defined(I_DIRENT)
12273 #include <dirent.h>
12276 #include <sys/ndir.h>
12280 #include <ndir.h> /* may be wrong in the future */
12282 #include <sys/dir.h>
12288 DIR *dirp = opendir(".");
12289 if (dirfd(dirp) >= 0)
12297 if eval $compile; then
12301 $define) echo "dirfd() found." >&4 ;;
12302 *) echo "dirfd() NOT found." >&4 ;;
12308 : see if dladdr exists
12309 set dladdr d_dladdr
12312 : see if dlerror exists
12315 set dlerror d_dlerror
12319 : see if dlfcn is available
12320 set dlfcn.h i_dlfcn
12323 : Check what extension to use for shared libs
12328 On a few systems, the dynamically loaded modules that perl generates and uses
12329 will need a different extension than shared libs. The default will probably
12335 *) dflt="$dlext" ;;
12337 rp='What is the extension of dynamically loaded modules'
12346 : Check if dlsym need a leading underscore
12352 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12353 $cat >dyna.c <<'EOM'
12360 #$i_stdlib I_STDLIB
12362 #include <stdlib.h>
12366 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12368 #include <sys/types.h>
12373 extern int fred() ;
12382 int mode = RTLD_LAZY ;
12384 handle = dlopen("./dyna.$dlext", mode) ;
12385 if (handle == NULL) {
12390 symbol = dlsym(handle, "fred") ;
12391 if (symbol == NULL) {
12392 /* try putting a leading underscore */
12393 symbol = dlsym(handle, "_fred") ;
12394 if (symbol == NULL) {
12407 : Call the object file tmp-dyna.o in case dlext=o.
12408 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12409 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12410 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12411 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12414 1) echo "Test program failed using dlopen." >&4
12415 echo "Perhaps you should not use dynamic loading." >&4;;
12416 2) echo "Test program failed using dlsym." >&4
12417 echo "Perhaps you should not use dynamic loading." >&4;;
12418 3) echo "dlsym needs a leading underscore" >&4
12420 4) echo "dlsym doesn't need a leading underscore." >&4;;
12423 echo "I can't compile and run the test program." >&4
12424 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12429 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12434 : see if drand48_r exists
12435 set drand48_r d_drand48_r
12437 case "$d_drand48_r" in
12439 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12440 case "$d_drand48_r_proto:$usethreads" in
12441 ":define") d_drand48_r_proto=define
12442 set d_drand48_r_proto drand48_r $hdrs
12446 case "$d_drand48_r_proto" in
12448 case "$drand48_r_proto" in
12449 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12450 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12452 case "$drand48_r_proto" in
12453 ''|0) d_drand48_r=undef
12455 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12456 * ) case "$drand48_r_proto" in
12457 REENTRANT_PROTO*) ;;
12458 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12460 echo "Prototype: $try" ;;
12463 *) case "$usethreads" in
12464 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12471 *) drand48_r_proto=0
12475 : see if prototype for drand48 is available
12477 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12480 : see if dup2 exists
12484 : see if eaccess exists
12485 set eaccess d_eaccess
12488 : see if endgrent exists
12489 set endgrent d_endgrent
12492 : see if this is an grp system
12498 xxx=`./findhdr grp.h`
12499 $cppstdin $cppflags $cppminus < $xxx >$$.h
12501 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12513 set d_grpasswd; eval $setvar
12517 : see if endgrent_r exists
12518 set endgrent_r d_endgrent_r
12520 case "$d_endgrent_r" in
12522 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12523 case "$d_endgrent_r_proto:$usethreads" in
12524 ":define") d_endgrent_r_proto=define
12525 set d_endgrent_r_proto endgrent_r $hdrs
12529 case "$d_endgrent_r_proto" in
12531 case "$endgrent_r_proto" in
12532 ''|0) try='int endgrent_r(FILE**);'
12533 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12535 case "$endgrent_r_proto" in
12536 ''|0) try='void endgrent_r(FILE**);'
12537 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12539 case "$endgrent_r_proto" in
12540 ''|0) d_endgrent_r=undef
12542 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12543 * ) case "$endgrent_r_proto" in
12544 REENTRANT_PROTO*) ;;
12545 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12547 echo "Prototype: $try" ;;
12550 *) case "$usethreads" in
12551 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12558 *) endgrent_r_proto=0
12562 : see if endhostent exists
12563 set endhostent d_endhent
12566 : see if this is a netdb.h system
12567 set netdb.h i_netdb
12570 : see if endhostent_r exists
12571 set endhostent_r d_endhostent_r
12573 case "$d_endhostent_r" in
12575 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12576 case "$d_endhostent_r_proto:$usethreads" in
12577 ":define") d_endhostent_r_proto=define
12578 set d_endhostent_r_proto endhostent_r $hdrs
12582 case "$d_endhostent_r_proto" in
12584 case "$endhostent_r_proto" in
12585 ''|0) try='int endhostent_r(struct hostent_data*);'
12586 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12588 case "$endhostent_r_proto" in
12589 ''|0) try='void endhostent_r(struct hostent_data*);'
12590 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12592 case "$endhostent_r_proto" in
12593 ''|0) d_endhostent_r=undef
12594 endhostent_r_proto=0
12595 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12596 * ) case "$endhostent_r_proto" in
12597 REENTRANT_PROTO*) ;;
12598 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12600 echo "Prototype: $try" ;;
12603 *) case "$usethreads" in
12604 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12606 d_endhostent_r=undef
12607 endhostent_r_proto=0
12611 *) endhostent_r_proto=0
12615 : see if endnetent exists
12616 set endnetent d_endnent
12619 : see if endnetent_r exists
12620 set endnetent_r d_endnetent_r
12622 case "$d_endnetent_r" in
12624 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12625 case "$d_endnetent_r_proto:$usethreads" in
12626 ":define") d_endnetent_r_proto=define
12627 set d_endnetent_r_proto endnetent_r $hdrs
12631 case "$d_endnetent_r_proto" in
12633 case "$endnetent_r_proto" in
12634 ''|0) try='int endnetent_r(struct netent_data*);'
12635 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12637 case "$endnetent_r_proto" in
12638 ''|0) try='void endnetent_r(struct netent_data*);'
12639 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12641 case "$endnetent_r_proto" in
12642 ''|0) d_endnetent_r=undef
12643 endnetent_r_proto=0
12644 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12645 * ) case "$endnetent_r_proto" in
12646 REENTRANT_PROTO*) ;;
12647 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12649 echo "Prototype: $try" ;;
12652 *) case "$usethreads" in
12653 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12655 d_endnetent_r=undef
12656 endnetent_r_proto=0
12660 *) endnetent_r_proto=0
12664 : see if endprotoent exists
12665 set endprotoent d_endpent
12668 : see if endprotoent_r exists
12669 set endprotoent_r d_endprotoent_r
12671 case "$d_endprotoent_r" in
12673 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12674 case "$d_endprotoent_r_proto:$usethreads" in
12675 ":define") d_endprotoent_r_proto=define
12676 set d_endprotoent_r_proto endprotoent_r $hdrs
12680 case "$d_endprotoent_r_proto" in
12682 case "$endprotoent_r_proto" in
12683 ''|0) try='int endprotoent_r(struct protoent_data*);'
12684 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12686 case "$endprotoent_r_proto" in
12687 ''|0) try='void endprotoent_r(struct protoent_data*);'
12688 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12690 case "$endprotoent_r_proto" in
12691 ''|0) d_endprotoent_r=undef
12692 endprotoent_r_proto=0
12693 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12694 * ) case "$endprotoent_r_proto" in
12695 REENTRANT_PROTO*) ;;
12696 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12698 echo "Prototype: $try" ;;
12701 *) case "$usethreads" in
12702 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12704 d_endprotoent_r=undef
12705 endprotoent_r_proto=0
12709 *) endprotoent_r_proto=0
12713 : see if endpwent exists
12714 set endpwent d_endpwent
12717 : see if this is a pwd.h system
12723 xxx=`./findhdr pwd.h`
12724 $cppstdin $cppflags $cppminus < $xxx >$$.h
12726 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12734 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12742 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12750 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12758 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12766 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12774 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12782 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12794 set d_pwquota; eval $setvar
12795 set d_pwage; eval $setvar
12796 set d_pwchange; eval $setvar
12797 set d_pwclass; eval $setvar
12798 set d_pwexpire; eval $setvar
12799 set d_pwcomment; eval $setvar
12800 set d_pwgecos; eval $setvar
12801 set d_pwpasswd; eval $setvar
12805 : see if endpwent_r exists
12806 set endpwent_r d_endpwent_r
12808 case "$d_endpwent_r" in
12810 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12811 case "$d_endpwent_r_proto:$usethreads" in
12812 ":define") d_endpwent_r_proto=define
12813 set d_endpwent_r_proto endpwent_r $hdrs
12817 case "$d_endpwent_r_proto" in
12819 case "$endpwent_r_proto" in
12820 ''|0) try='int endpwent_r(FILE**);'
12821 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12823 case "$endpwent_r_proto" in
12824 ''|0) try='void endpwent_r(FILE**);'
12825 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12827 case "$endpwent_r_proto" in
12828 ''|0) d_endpwent_r=undef
12830 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12831 * ) case "$endpwent_r_proto" in
12832 REENTRANT_PROTO*) ;;
12833 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12835 echo "Prototype: $try" ;;
12838 *) case "$usethreads" in
12839 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12846 *) endpwent_r_proto=0
12850 : see if endservent exists
12851 set endservent d_endsent
12854 : see if endservent_r exists
12855 set endservent_r d_endservent_r
12857 case "$d_endservent_r" in
12859 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12860 case "$d_endservent_r_proto:$usethreads" in
12861 ":define") d_endservent_r_proto=define
12862 set d_endservent_r_proto endservent_r $hdrs
12866 case "$d_endservent_r_proto" in
12868 case "$endservent_r_proto" in
12869 ''|0) try='int endservent_r(struct servent_data*);'
12870 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12872 case "$endservent_r_proto" in
12873 ''|0) try='void endservent_r(struct servent_data*);'
12874 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12876 case "$endservent_r_proto" in
12877 ''|0) d_endservent_r=undef
12878 endservent_r_proto=0
12879 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12880 * ) case "$endservent_r_proto" in
12881 REENTRANT_PROTO*) ;;
12882 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12884 echo "Prototype: $try" ;;
12887 *) case "$usethreads" in
12888 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12890 d_endservent_r=undef
12891 endservent_r_proto=0
12895 *) endservent_r_proto=0
12899 : Locate the flags for 'open()'
12902 #include <sys/types.h>
12907 #include <sys/file.h>
12909 #$i_stdlib I_STDLIB
12911 #include <stdlib.h>
12922 : check sys/file.h first to get FREAD on Sun
12923 if $test `./findhdr sys/file.h` && \
12924 set try -DI_SYS_FILE && eval $compile; then
12926 echo "<sys/file.h> defines the O_* constants..." >&4
12927 if $run ./try; then
12928 echo "and you have the 3 argument form of open()." >&4
12931 echo "but not the 3 argument form of open(). Oh, well." >&4
12934 elif $test `./findhdr fcntl.h` && \
12935 set try -DI_FCNTL && eval $compile; then
12937 echo "<fcntl.h> defines the O_* constants..." >&4
12938 if $run ./try; then
12939 echo "and you have the 3 argument form of open()." >&4
12942 echo "but not the 3 argument form of open(). Oh, well." >&4
12947 echo "I can't find the O_* constant definitions! You got problems." >&4
12953 : see if this is a sys/file.h system
12958 : do we need to include sys/file.h ?
12962 if $h_sysfile; then
12964 echo "We'll be including <sys/file.h>." >&4
12967 echo "We won't be including <sys/file.h>." >&4
12977 : see if fcntl.h is there
12982 : see if we can include fcntl.h
12988 echo "We'll be including <fcntl.h>." >&4
12991 if $h_sysfile; then
12992 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12994 echo "We won't be including <fcntl.h>." >&4
13006 : see if fork exists
13010 : see if pipe exists
13014 : check for non-blocking I/O stuff
13015 case "$h_sysfile" in
13016 true) echo "#include <sys/file.h>" > head.c;;
13019 true) echo "#include <fcntl.h>" > head.c;;
13020 *) echo "#include <sys/fcntl.h>" > head.c;;
13025 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13026 case "$o_nonblock" in
13028 $cat head.c > try.c
13029 $cat >>try.c <<EOCP
13031 #$i_stdlib I_STDLIB
13033 #include <stdlib.h>
13041 printf("O_NONBLOCK\n");
13045 printf("O_NDELAY\n");
13049 printf("FNDELAY\n");
13056 if eval $compile_ok; then
13057 o_nonblock=`$run ./try`
13058 case "$o_nonblock" in
13059 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13060 *) echo "Seems like we can use $o_nonblock.";;
13063 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13066 *) echo "Using $hint value $o_nonblock.";;
13071 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13074 case "$d_fork:$d_pipe" in
13076 $cat head.c > try.c
13077 $cat >>try.c <<EOCP
13079 #include <sys/types.h>
13080 #include <signal.h>
13082 #$i_stdlib I_STDLIB
13084 #include <stdlib.h>
13090 #define MY_O_NONBLOCK $o_nonblock
13091 #ifndef errno /* XXX need better Configure test */
13094 #$i_unistd I_UNISTD
13096 #include <unistd.h>
13098 #$i_string I_STRING
13100 #include <string.h>
13102 #include <strings.h>
13104 $signal_t blech(int x) { exit(3); }
13106 $cat >> try.c <<'EOCP'
13115 ret = pipe(pd); /* Down: child -> parent */
13118 ret = pipe(pu); /* Up: parent -> child */
13122 close(pd[1]); /* Parent reads from pd[0] */
13123 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13125 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13130 signal(SIGALRM, blech);
13132 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13134 sprintf(string, "%d\n", ret);
13135 ret = write(2, string, strlen(string));
13136 if (ret != strlen(string))
13140 if (errno == EAGAIN) {
13141 printf("EAGAIN\n");
13146 if (errno == EWOULDBLOCK)
13147 printf("EWOULDBLOCK\n");
13150 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13153 sleep(2); /* Give it time to close our pipe */
13155 ret = read(pd[0], buf, 1); /* Should read EOF */
13157 sprintf(string, "%d\n", ret);
13158 ret = write(4, string, strlen(string));
13159 if (ret != strlen(string))
13164 close(pd[0]); /* We write to pd[1] */
13165 close(pu[1]); /* We read from pu[0] */
13166 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13169 close(pd[1]); /* Pipe pd is now fully closed! */
13170 exit(0); /* Bye bye, thank you for playing! */
13174 if eval $compile_ok; then
13175 echo "$startsh" >mtry
13176 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13178 $run ./mtry >/dev/null 2>&1
13180 0) eagain=`$cat try.out`;;
13181 1) echo "Could not perform non-blocking setting!";;
13182 2) echo "I did a successful read() for something that was not there!";;
13183 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13184 4) echo "Could not find F_SETFL!";;
13185 *) echo "Something terribly wrong happened during testing.";;
13187 rd_nodata=`$cat try.ret`
13188 echo "A read() system call with no data present returns $rd_nodata."
13189 case "$rd_nodata" in
13192 echo "(That's peculiar, fixing that to be -1.)"
13198 echo "Forcing errno EAGAIN on read() with no data available."
13202 echo "Your read() sets errno to $eagain when no data is available."
13205 status=`$cat try.err`
13207 0) echo "And it correctly returns 0 to signal EOF.";;
13208 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13209 *) echo "However, your read() returns '$status' on EOF??";;
13212 if test "$status" = "$rd_nodata"; then
13213 echo "WARNING: you can't distinguish between EOF and no data!"
13217 echo "I can't compile the test program--assuming errno EAGAIN will do."
13221 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13230 echo "Using $hint value $eagain."
13231 echo "Your read() returns $rd_nodata when no data is present."
13232 case "$d_eofnblk" in
13233 "$define") echo "And you can see EOF because read() returns 0.";;
13234 "$undef") echo "But you can't see EOF status from read() returned value.";;
13236 echo "(Assuming you can't see EOF status from read anyway.)"
13242 $rm_try head.c mtry
13244 : see if _ptr and _cnt from stdio act std
13247 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13248 echo "(Looks like you have stdio.h from BSD.)"
13249 case "$stdio_ptr" in
13250 '') stdio_ptr='((fp)->_p)'
13253 *) ptr_lval=$d_stdio_ptr_lval;;
13255 case "$stdio_cnt" in
13256 '') stdio_cnt='((fp)->_r)'
13259 *) cnt_lval=$d_stdio_cnt_lval;;
13261 case "$stdio_base" in
13262 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13264 case "$stdio_bufsiz" in
13265 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13267 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13268 echo "(Looks like you have stdio.h from Linux.)"
13269 case "$stdio_ptr" in
13270 '') stdio_ptr='((fp)->_IO_read_ptr)'
13273 *) ptr_lval=$d_stdio_ptr_lval;;
13275 case "$stdio_cnt" in
13276 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13279 *) cnt_lval=$d_stdio_cnt_lval;;
13281 case "$stdio_base" in
13282 '') stdio_base='((fp)->_IO_read_base)';;
13284 case "$stdio_bufsiz" in
13285 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13288 case "$stdio_ptr" in
13289 '') stdio_ptr='((fp)->_ptr)'
13292 *) ptr_lval=$d_stdio_ptr_lval;;
13294 case "$stdio_cnt" in
13295 '') stdio_cnt='((fp)->_cnt)'
13298 *) cnt_lval=$d_stdio_cnt_lval;;
13300 case "$stdio_base" in
13301 '') stdio_base='((fp)->_base)';;
13303 case "$stdio_bufsiz" in
13304 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13308 : test whether _ptr and _cnt really work
13309 echo "Checking how std your stdio is..." >&4
13312 #$i_stdlib I_STDLIB
13314 #include <stdlib.h>
13316 #define FILE_ptr(fp) $stdio_ptr
13317 #define FILE_cnt(fp) $stdio_cnt
13319 FILE *fp = fopen("try.c", "r");
13322 18 <= FILE_cnt(fp) &&
13323 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13331 if eval $compile && $to try.c; then
13332 if $run ./try; then
13333 echo "Your stdio acts pretty std."
13336 echo "Your stdio isn't very std."
13339 echo "Your stdio doesn't appear very std."
13343 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13344 # direct buffer manipulation no longer works. The Configure tests
13345 # should be changed to correctly detect this, but until then,
13346 # the following check should at least let perl compile and run.
13347 # (This quick fix should be updated before 5.8.1.)
13348 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13349 # A. Dougherty, June 3, 2002.
13350 case "$d_gnulibc" in
13352 case "$gnulibc_version" in
13356 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13365 : Can _ptr be used as an lvalue?
13366 case "$d_stdstdio$ptr_lval" in
13367 $define$define) val=$define ;;
13370 set d_stdio_ptr_lval
13373 : Can _cnt be used as an lvalue?
13374 case "$d_stdstdio$cnt_lval" in
13375 $define$define) val=$define ;;
13378 set d_stdio_cnt_lval
13382 : test whether setting _ptr sets _cnt as a side effect
13383 d_stdio_ptr_lval_sets_cnt="$undef"
13384 d_stdio_ptr_lval_nochange_cnt="$undef"
13385 case "$d_stdio_ptr_lval$d_stdstdio" in
13387 echo "Checking to see what happens if we set the stdio ptr..." >&4
13390 /* Can we scream? */
13391 /* Eat dust sed :-) */
13392 /* In the buffer space, no one can hear you scream. */
13393 #$i_stdlib I_STDLIB
13395 #include <stdlib.h>
13397 #define FILE_ptr(fp) $stdio_ptr
13398 #define FILE_cnt(fp) $stdio_cnt
13399 #include <sys/types.h>
13401 FILE *fp = fopen("try.c", "r");
13406 puts("Fail even to read");
13409 c = getc(fp); /* Read away the first # */
13411 puts("Fail even to read");
13415 18 <= FILE_cnt(fp) &&
13416 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13418 puts("Fail even to read");
13421 ptr = (char*) FILE_ptr(fp);
13422 cnt = (size_t)FILE_cnt(fp);
13424 FILE_ptr(fp) += 42;
13426 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13427 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13430 if (FILE_cnt(fp) <= 20) {
13431 printf ("Fail (<20 chars to test)");
13434 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13435 puts("Fail compare");
13438 if (cnt == FILE_cnt(fp)) {
13439 puts("Pass_unchanged");
13442 if (FILE_cnt(fp) == (cnt - 42)) {
13443 puts("Pass_changed");
13446 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13452 if eval $compile && $to try.c; then
13453 case `$run ./try` in
13455 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13456 d_stdio_ptr_lval_sets_cnt="$define" ;;
13458 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13459 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13461 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13463 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13466 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13472 : see if _base is also standard
13474 case "$d_stdstdio" in
13478 #$i_stdlib I_STDLIB
13480 #include <stdlib.h>
13482 #define FILE_base(fp) $stdio_base
13483 #define FILE_bufsiz(fp) $stdio_bufsiz
13485 FILE *fp = fopen("try.c", "r");
13488 19 <= FILE_bufsiz(fp) &&
13489 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13496 if eval $compile && $to try.c; then
13497 if $run ./try; then
13498 echo "And its _base field acts std."
13501 echo "But its _base field isn't std."
13504 echo "However, it seems to be lacking the _base field."
13512 : see if fast_stdio exists
13514 case "$d_stdstdio:$d_stdio_ptr_lval" in
13516 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13518 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13529 : see if fchdir exists
13530 set fchdir d_fchdir
13533 : see if fchmod exists
13534 set fchmod d_fchmod
13537 : see if fchown exists
13538 set fchown d_fchown
13541 : see if this is an fcntl system
13545 : See if fcntl-based locking works.
13548 #$i_stdlib I_STDLIB
13550 #include <stdlib.h>
13552 #include <unistd.h>
13554 #include <signal.h>
13555 $signal_t blech(int x) { exit(3); }
13557 #if defined(F_SETLK) && defined(F_SETLKW)
13558 struct flock flock;
13560 fd = open("try.c", O_RDONLY);
13561 flock.l_type = F_RDLCK;
13562 flock.l_whence = SEEK_SET;
13563 flock.l_start = flock.l_len = 0;
13564 signal(SIGALRM, blech);
13566 retval = fcntl(fd, F_SETLK, &flock);
13568 (retval < 0 ? exit(2) : exit(0));
13574 echo "Checking if fcntl-based file locking works... "
13578 if eval $compile_ok; then
13579 if $run ./try; then
13580 echo "Yes, it seems to work."
13583 echo "Nope, it didn't work."
13588 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13589 *** This is (almost) impossible.
13590 *** If your NFS lock daemons are not feeling well, something like
13591 *** this may happen, please investigate. Cannot continue, aborting.
13599 echo "I'm unable to compile the test program, so I'll assume not."
13604 echo "Nope, since you don't even have fcntl()."
13607 set d_fcntl_can_lock
13611 : check for fd_set items
13614 Checking to see how well your C compiler handles fd_set and friends ...
13617 #$i_stdlib I_STDLIB
13619 #include <stdlib.h>
13621 #$i_systime I_SYS_TIME
13622 #$i_sysselct I_SYS_SELECT
13623 #$d_socket HAS_SOCKET
13624 #include <sys/types.h>
13626 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13629 #include <sys/time.h>
13631 #ifdef I_SYS_SELECT
13632 #include <sys/select.h>
13641 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13649 if eval $compile; then
13650 d_fds_bits="$define"
13652 echo "Well, your system knows about the normal fd_set typedef..." >&4
13653 if $run ./try; then
13654 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13655 d_fd_macros="$define"
13658 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13660 d_fd_macros="$undef"
13664 Hmm, your compiler has some difficulty with fd_set. Checking further...
13667 if eval $compile; then
13668 d_fds_bits="$undef"
13670 echo "Well, your system has some sort of fd_set available..." >&4
13671 if $run ./try; then
13672 echo "and you have the normal fd_set macros." >&4
13673 d_fd_macros="$define"
13676 but not the normal fd_set macros! Gross! More work for me...
13678 d_fd_macros="$undef"
13681 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13683 d_fds_bits="$undef"
13684 d_fd_macros="$undef"
13689 : see if fegetround exists
13690 set fegetround d_fegetround
13693 : see if fgetpos exists
13694 set fgetpos d_fgetpos
13697 : see if finite exists
13698 set finite d_finite
13701 : see if finitel exists
13702 set finitel d_finitel
13705 : see if flock exists
13709 : see if prototype for flock is available
13711 set d_flockproto flock $i_sysfile sys/file.h
13714 : see if fp_class exists
13715 set fp_class d_fp_class
13718 : see if fp_classl exists
13719 set fp_classl d_fp_classl
13722 : see if pathconf exists
13723 set pathconf d_pathconf
13726 : see if fpathconf exists
13727 set fpathconf d_fpathconf
13730 : see if fpclass exists
13731 set fpclass d_fpclass
13734 : see if fp_classify exists
13735 set fp_classify d_fp_classify
13738 : see if fpclassl exists
13739 set fpclassl d_fpclassl
13742 : see if fpgetround exists
13743 set fpgetround d_fpgetround
13746 : check for fpos64_t
13748 echo "Checking to see if you have fpos64_t..." >&4
13751 int main() { fpos64_t x = 7; }
13754 if eval $compile; then
13756 echo "You have fpos64_t."
13759 echo "You do not have fpos64_t."
13760 case "$fpossize" in
13761 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13768 : see if frexpl exists
13769 set frexpl d_frexpl
13772 : see if this is a sys/param system
13773 set sys/param.h i_sysparam
13776 : see if this is a sys/mount.h system
13777 set sys/mount.h i_sysmount
13780 : Check for fs_data_s
13782 echo "Checking to see if your system supports struct fs_data..." >&4
13783 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13785 case "$d_fs_data_s" in
13786 "$define") echo "Yes, it does." ;;
13787 *) echo "No, it doesn't." ;;
13790 : see if fseeko exists
13791 set fseeko d_fseeko
13793 case "$longsize" in
13794 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13797 : see if fsetpos exists
13798 set fsetpos d_fsetpos
13801 : see if fstatfs exists
13802 set fstatfs d_fstatfs
13805 : see if statvfs exists
13806 set statvfs d_statvfs
13809 : see if fstatvfs exists
13810 set fstatvfs d_fstatvfs
13814 : see if fsync exists
13818 : see if ftello exists
13819 set ftello d_ftello
13821 case "$longsize" in
13822 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13825 : check for a working futimes
13828 echo "Checking if you have a working futimes()" >&4
13831 #include <sys/time.h>
13838 fd = open ("try.c", O_RDWR);
13839 if (-1 == fd) exit (1);
13840 rv = futimes (fd, NULL);
13841 exit (rv == -1 ? errno : 0);
13845 if eval $compile; then
13849 0) echo "Yes, you have" >&4
13850 d_futimes="$define"
13852 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13856 echo "No, it does not (probably harmless)" >&4
13860 : see if ndbm.h is available
13863 : Compatibility location for RedHat 7.1
13864 set gdbm/ndbm.h i_gdbmndbm
13866 : Compatibility location for Debian 4.0
13867 set gdbm-ndbm.h i_gdbm_ndbm
13871 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13872 : see if dbm_open exists
13873 set dbm_open d_dbm_open
13875 case "$d_dbm_open" in
13878 i_gdbmndbm="$undef"
13879 i_gdbm_ndbm="$undef"
13880 echo "We won't be including <ndbm.h>"
13890 ndbm_hdr_protochk='name=$1; hdr=$2;
13891 eval "ihdr=\$""i_$name";
13893 if $test "$ihdr" = "$define"; then
13894 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13895 case "$d_cplusplus" in
13896 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13897 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13900 $define) $echo "Your <$hdr> seems to have prototypes";;
13901 *) $echo "Your <$hdr> does not seem to have prototypes";;
13904 set "d_${name}_h_uses_prototypes";
13908 eval $ndbm_hdr_protochk
13909 set gdbmndbm gdbm/ndbm.h
13910 eval $ndbm_hdr_protochk
13911 set gdbm_ndbm gdbm-ndbm.h
13912 eval $ndbm_hdr_protochk
13914 : see if getaddrinfo exists
13915 set getaddrinfo d_getaddrinfo
13918 : see if getcwd exists
13919 set getcwd d_getcwd
13922 : see if getespwnam exists
13923 set getespwnam d_getespwnam
13926 : see if getfsstat exists
13927 set getfsstat d_getfsstat
13930 : see if getgrent exists
13931 set getgrent d_getgrent
13934 : see if getgrent_r exists
13935 set getgrent_r d_getgrent_r
13937 case "$d_getgrent_r" in
13939 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13940 case "$d_getgrent_r_proto:$usethreads" in
13941 ":define") d_getgrent_r_proto=define
13942 set d_getgrent_r_proto getgrent_r $hdrs
13946 case "$d_getgrent_r_proto" in
13948 case "$getgrent_r_proto" in
13949 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13950 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13952 case "$getgrent_r_proto" in
13953 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13954 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13956 case "$getgrent_r_proto" in
13957 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13958 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13960 case "$getgrent_r_proto" in
13961 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13962 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13964 case "$getgrent_r_proto" in
13965 ''|0) try='int getgrent_r(struct group*, char*, int);'
13966 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13968 case "$getgrent_r_proto" in
13969 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13970 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13972 case "$getgrent_r_proto" in
13973 ''|0) d_getgrent_r=undef
13975 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13976 * ) case "$getgrent_r_proto" in
13977 REENTRANT_PROTO*) ;;
13978 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13980 echo "Prototype: $try" ;;
13983 *) case "$usethreads" in
13984 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13991 *) getgrent_r_proto=0
13995 : see if getgrgid_r exists
13996 set getgrgid_r d_getgrgid_r
13998 case "$d_getgrgid_r" in
14000 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14001 case "$d_getgrgid_r_proto:$usethreads" in
14002 ":define") d_getgrgid_r_proto=define
14003 set d_getgrgid_r_proto getgrgid_r $hdrs
14007 case "$d_getgrgid_r_proto" in
14009 case "$getgrgid_r_proto" in
14010 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14011 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14013 case "$getgrgid_r_proto" in
14014 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14015 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14017 case "$getgrgid_r_proto" in
14018 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14019 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14021 case "$getgrgid_r_proto" in
14022 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14023 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14025 case "$getgrgid_r_proto" in
14026 ''|0) d_getgrgid_r=undef
14028 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14029 * ) case "$getgrgid_r_proto" in
14030 REENTRANT_PROTO*) ;;
14031 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14033 echo "Prototype: $try" ;;
14036 *) case "$usethreads" in
14037 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14044 *) getgrgid_r_proto=0
14048 : see if getgrnam_r exists
14049 set getgrnam_r d_getgrnam_r
14051 case "$d_getgrnam_r" in
14053 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14054 case "$d_getgrnam_r_proto:$usethreads" in
14055 ":define") d_getgrnam_r_proto=define
14056 set d_getgrnam_r_proto getgrnam_r $hdrs
14060 case "$d_getgrnam_r_proto" in
14062 case "$getgrnam_r_proto" in
14063 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14064 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14066 case "$getgrnam_r_proto" in
14067 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14068 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14070 case "$getgrnam_r_proto" in
14071 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14072 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14074 case "$getgrnam_r_proto" in
14075 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14076 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14078 case "$getgrnam_r_proto" in
14079 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14080 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14082 case "$getgrnam_r_proto" in
14083 ''|0) d_getgrnam_r=undef
14085 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14086 * ) case "$getgrnam_r_proto" in
14087 REENTRANT_PROTO*) ;;
14088 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14090 echo "Prototype: $try" ;;
14093 *) case "$usethreads" in
14094 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14101 *) getgrnam_r_proto=0
14105 : see if gethostbyaddr exists
14106 set gethostbyaddr d_gethbyaddr
14109 : see if gethostbyname exists
14110 set gethostbyname d_gethbyname
14113 : see if gethostent exists
14114 set gethostent d_gethent
14117 : see how we will look up host name
14120 if set gethostname val -f d_gethname; eval $csym; $val; then
14121 echo 'gethostname() found.' >&4
14122 d_gethname="$define"
14125 if set uname val -f d_uname; eval $csym; $val; then
14128 uname() was found, but you're running xenix, and older versions of xenix
14129 have a broken uname(). If you don't really know whether your xenix is old
14130 enough to have a broken system call, use the default answer.
14135 "$define") dflt=n;;
14137 rp='Is your uname() broken?'
14140 n*) d_uname="$define"; call=uname;;
14143 echo 'uname() found.' >&4
14150 case "$d_gethname" in
14151 '') d_gethname="$undef";;
14154 '') d_uname="$undef";;
14156 case "$d_uname$d_gethname" in
14161 Every now and then someone has a $call() that lies about the hostname
14162 but can't be fixed for political or economic reasons. If you wish, I can
14163 pretend $call() isn't there and maybe compute hostname at run-time
14164 thanks to the '$phostname' command.
14167 rp="Shall I ignore $call() from now on?"
14170 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14173 case "$phostname" in
14174 '') aphostname='';;
14175 *) case "$aphostname" in
14177 *) set X $phostname
14181 file=`./loc $file $file $pth`
14182 aphostname=`echo $file $*`
14187 case "$d_uname$d_gethname" in
14190 case "$phostname" in
14192 echo "There will be no way for $package to get your hostname." >&4;;
14194 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14198 case "$d_phostname" in
14199 '') d_phostname="$undef";;
14202 : see if gethostbyaddr_r exists
14203 set gethostbyaddr_r d_gethostbyaddr_r
14205 case "$d_gethostbyaddr_r" in
14207 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14208 case "$d_gethostbyaddr_r_proto:$usethreads" in
14209 ":define") d_gethostbyaddr_r_proto=define
14210 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14214 case "$d_gethostbyaddr_r_proto" in
14216 case "$gethostbyaddr_r_proto" in
14217 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14218 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14220 case "$gethostbyaddr_r_proto" in
14221 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14222 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14224 case "$gethostbyaddr_r_proto" in
14225 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14226 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14228 case "$gethostbyaddr_r_proto" in
14229 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14230 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14232 case "$gethostbyaddr_r_proto" in
14233 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14234 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14236 case "$gethostbyaddr_r_proto" in
14237 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14238 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14240 case "$gethostbyaddr_r_proto" in
14241 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14242 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14244 case "$gethostbyaddr_r_proto" in
14245 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14246 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14248 case "$gethostbyaddr_r_proto" in
14249 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14250 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14252 case "$gethostbyaddr_r_proto" in
14253 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14254 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14256 case "$gethostbyaddr_r_proto" in
14257 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14258 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14260 case "$gethostbyaddr_r_proto" in
14261 ''|0) d_gethostbyaddr_r=undef
14262 gethostbyaddr_r_proto=0
14263 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14264 * ) case "$gethostbyaddr_r_proto" in
14265 REENTRANT_PROTO*) ;;
14266 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14268 echo "Prototype: $try" ;;
14271 *) case "$usethreads" in
14272 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14274 d_gethostbyaddr_r=undef
14275 gethostbyaddr_r_proto=0
14279 *) gethostbyaddr_r_proto=0
14283 : see if gethostbyname_r exists
14284 set gethostbyname_r d_gethostbyname_r
14286 case "$d_gethostbyname_r" in
14288 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14289 case "$d_gethostbyname_r_proto:$usethreads" in
14290 ":define") d_gethostbyname_r_proto=define
14291 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14295 case "$d_gethostbyname_r_proto" in
14297 case "$gethostbyname_r_proto" in
14298 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14299 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14301 case "$gethostbyname_r_proto" in
14302 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14303 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14305 case "$gethostbyname_r_proto" in
14306 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14307 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14309 case "$gethostbyname_r_proto" in
14310 ''|0) d_gethostbyname_r=undef
14311 gethostbyname_r_proto=0
14312 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14313 * ) case "$gethostbyname_r_proto" in
14314 REENTRANT_PROTO*) ;;
14315 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14317 echo "Prototype: $try" ;;
14320 *) case "$usethreads" in
14321 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14323 d_gethostbyname_r=undef
14324 gethostbyname_r_proto=0
14328 *) gethostbyname_r_proto=0
14332 : see if gethostent_r exists
14333 set gethostent_r d_gethostent_r
14335 case "$d_gethostent_r" in
14337 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14338 case "$d_gethostent_r_proto:$usethreads" in
14339 ":define") d_gethostent_r_proto=define
14340 set d_gethostent_r_proto gethostent_r $hdrs
14344 case "$d_gethostent_r_proto" in
14346 case "$gethostent_r_proto" in
14347 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14348 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14350 case "$gethostent_r_proto" in
14351 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14352 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14354 case "$gethostent_r_proto" in
14355 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14356 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14358 case "$gethostent_r_proto" in
14359 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14360 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14362 case "$gethostent_r_proto" in
14363 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14364 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14366 case "$gethostent_r_proto" in
14367 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14368 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14370 case "$gethostent_r_proto" in
14371 ''|0) d_gethostent_r=undef
14372 gethostent_r_proto=0
14373 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14374 * ) case "$gethostent_r_proto" in
14375 REENTRANT_PROTO*) ;;
14376 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14378 echo "Prototype: $try" ;;
14381 *) case "$usethreads" in
14382 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14384 d_gethostent_r=undef
14385 gethostent_r_proto=0
14389 *) gethostent_r_proto=0
14393 : see if prototypes for various gethostxxx netdb.h functions are available
14395 set d_gethostprotos gethostent $i_netdb netdb.h
14398 : see if getitimer exists
14399 set getitimer d_getitimer
14402 : see if getlogin exists
14403 set getlogin d_getlogin
14406 : see if getlogin_r exists
14407 set getlogin_r d_getlogin_r
14409 case "$d_getlogin_r" in
14411 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14412 case "$d_getlogin_r_proto:$usethreads" in
14413 ":define") d_getlogin_r_proto=define
14414 set d_getlogin_r_proto getlogin_r $hdrs
14418 case "$d_getlogin_r_proto" in
14420 case "$getlogin_r_proto" in
14421 ''|0) try='int getlogin_r(char*, size_t);'
14422 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14424 case "$getlogin_r_proto" in
14425 ''|0) try='int getlogin_r(char*, int);'
14426 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14428 case "$getlogin_r_proto" in
14429 ''|0) try='char* getlogin_r(char*, size_t);'
14430 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14432 case "$getlogin_r_proto" in
14433 ''|0) try='char* getlogin_r(char*, int);'
14434 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14436 case "$getlogin_r_proto" in
14437 ''|0) d_getlogin_r=undef
14439 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14440 * ) case "$getlogin_r_proto" in
14441 REENTRANT_PROTO*) ;;
14442 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14444 echo "Prototype: $try" ;;
14447 *) case "$usethreads" in
14448 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14455 *) getlogin_r_proto=0
14459 : see if getmnt exists
14460 set getmnt d_getmnt
14463 : see if getmntent exists
14464 set getmntent d_getmntent
14467 : see if getnameinfo exists
14468 set getnameinfo d_getnameinfo
14471 : see if getnetbyaddr exists
14472 set getnetbyaddr d_getnbyaddr
14475 : see if getnetbyname exists
14476 set getnetbyname d_getnbyname
14479 : see if getnetent exists
14480 set getnetent d_getnent
14483 : see if getnetbyaddr_r exists
14484 set getnetbyaddr_r d_getnetbyaddr_r
14486 case "$d_getnetbyaddr_r" in
14488 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14489 case "$d_getnetbyaddr_r_proto:$usethreads" in
14490 ":define") d_getnetbyaddr_r_proto=define
14491 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14495 case "$d_getnetbyaddr_r_proto" in
14497 case "$getnetbyaddr_r_proto" in
14498 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14499 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14501 case "$getnetbyaddr_r_proto" in
14502 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14503 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14505 case "$getnetbyaddr_r_proto" in
14506 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14507 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14509 case "$getnetbyaddr_r_proto" in
14510 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14511 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14513 case "$getnetbyaddr_r_proto" in
14514 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14515 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14517 case "$getnetbyaddr_r_proto" in
14518 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14519 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14521 case "$getnetbyaddr_r_proto" in
14522 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14523 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14525 case "$getnetbyaddr_r_proto" in
14526 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14527 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14529 case "$getnetbyaddr_r_proto" in
14530 ''|0) d_getnetbyaddr_r=undef
14531 getnetbyaddr_r_proto=0
14532 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14533 * ) case "$getnetbyaddr_r_proto" in
14534 REENTRANT_PROTO*) ;;
14535 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14537 echo "Prototype: $try" ;;
14540 *) case "$usethreads" in
14541 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14543 d_getnetbyaddr_r=undef
14544 getnetbyaddr_r_proto=0
14548 *) getnetbyaddr_r_proto=0
14552 : see if getnetbyname_r exists
14553 set getnetbyname_r d_getnetbyname_r
14555 case "$d_getnetbyname_r" in
14557 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14558 case "$d_getnetbyname_r_proto:$usethreads" in
14559 ":define") d_getnetbyname_r_proto=define
14560 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14564 case "$d_getnetbyname_r_proto" in
14566 case "$getnetbyname_r_proto" in
14567 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14568 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14570 case "$getnetbyname_r_proto" in
14571 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14572 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14574 case "$getnetbyname_r_proto" in
14575 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14576 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14578 case "$getnetbyname_r_proto" in
14579 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14580 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14582 case "$getnetbyname_r_proto" in
14583 ''|0) d_getnetbyname_r=undef
14584 getnetbyname_r_proto=0
14585 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14586 * ) case "$getnetbyname_r_proto" in
14587 REENTRANT_PROTO*) ;;
14588 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14590 echo "Prototype: $try" ;;
14593 *) case "$usethreads" in
14594 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14596 d_getnetbyname_r=undef
14597 getnetbyname_r_proto=0
14601 *) getnetbyname_r_proto=0
14605 : see if getnetent_r exists
14606 set getnetent_r d_getnetent_r
14608 case "$d_getnetent_r" in
14610 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14611 case "$d_getnetent_r_proto:$usethreads" in
14612 ":define") d_getnetent_r_proto=define
14613 set d_getnetent_r_proto getnetent_r $hdrs
14617 case "$d_getnetent_r_proto" in
14619 case "$getnetent_r_proto" in
14620 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14621 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14623 case "$getnetent_r_proto" in
14624 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14625 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14627 case "$getnetent_r_proto" in
14628 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14629 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14631 case "$getnetent_r_proto" in
14632 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14633 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14635 case "$getnetent_r_proto" in
14636 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14637 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14639 case "$getnetent_r_proto" in
14640 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14641 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14643 case "$getnetent_r_proto" in
14644 ''|0) d_getnetent_r=undef
14645 getnetent_r_proto=0
14646 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14647 * ) case "$getnetent_r_proto" in
14648 REENTRANT_PROTO*) ;;
14649 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14651 echo "Prototype: $try" ;;
14654 *) case "$usethreads" in
14655 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14657 d_getnetent_r=undef
14658 getnetent_r_proto=0
14662 *) getnetent_r_proto=0
14666 : see if prototypes for various getnetxxx netdb.h functions are available
14668 set d_getnetprotos getnetent $i_netdb netdb.h
14671 : see if getpagesize exists
14672 set getpagesize d_getpagsz
14675 : Optional checks for getprotobyname and getprotobynumber
14677 : see if getprotobyname exists
14678 set getprotobyname d_getpbyname
14681 : see if getprotobynumber exists
14682 set getprotobynumber d_getpbynumber
14685 : see if getprotoent exists
14686 set getprotoent d_getpent
14689 : see if getpgid exists
14690 set getpgid d_getpgid
14693 : see if getpgrp2 exists
14694 set getpgrp2 d_getpgrp2
14697 : see if getppid exists
14698 set getppid d_getppid
14701 : see if getpriority exists
14702 set getpriority d_getprior
14705 : see if getprotobyname_r exists
14706 set getprotobyname_r d_getprotobyname_r
14708 case "$d_getprotobyname_r" in
14710 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14711 case "$d_getprotobyname_r_proto:$usethreads" in
14712 ":define") d_getprotobyname_r_proto=define
14713 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14717 case "$d_getprotobyname_r_proto" in
14719 case "$getprotobyname_r_proto" in
14720 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14721 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14723 case "$getprotobyname_r_proto" in
14724 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14725 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14727 case "$getprotobyname_r_proto" in
14728 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14729 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14731 case "$getprotobyname_r_proto" in
14732 ''|0) d_getprotobyname_r=undef
14733 getprotobyname_r_proto=0
14734 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14735 * ) case "$getprotobyname_r_proto" in
14736 REENTRANT_PROTO*) ;;
14737 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14739 echo "Prototype: $try" ;;
14742 *) case "$usethreads" in
14743 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14745 d_getprotobyname_r=undef
14746 getprotobyname_r_proto=0
14750 *) getprotobyname_r_proto=0
14754 : see if getprotobynumber_r exists
14755 set getprotobynumber_r d_getprotobynumber_r
14757 case "$d_getprotobynumber_r" in
14759 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14760 case "$d_getprotobynumber_r_proto:$usethreads" in
14761 ":define") d_getprotobynumber_r_proto=define
14762 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14766 case "$d_getprotobynumber_r_proto" in
14768 case "$getprotobynumber_r_proto" in
14769 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14770 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14772 case "$getprotobynumber_r_proto" in
14773 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14774 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14776 case "$getprotobynumber_r_proto" in
14777 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14778 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14780 case "$getprotobynumber_r_proto" in
14781 ''|0) d_getprotobynumber_r=undef
14782 getprotobynumber_r_proto=0
14783 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14784 * ) case "$getprotobynumber_r_proto" in
14785 REENTRANT_PROTO*) ;;
14786 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14788 echo "Prototype: $try" ;;
14791 *) case "$usethreads" in
14792 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14794 d_getprotobynumber_r=undef
14795 getprotobynumber_r_proto=0
14799 *) getprotobynumber_r_proto=0
14803 : see if getprotoent_r exists
14804 set getprotoent_r d_getprotoent_r
14806 case "$d_getprotoent_r" in
14808 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14809 case "$d_getprotoent_r_proto:$usethreads" in
14810 ":define") d_getprotoent_r_proto=define
14811 set d_getprotoent_r_proto getprotoent_r $hdrs
14815 case "$d_getprotoent_r_proto" in
14817 case "$getprotoent_r_proto" in
14818 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14819 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14821 case "$getprotoent_r_proto" in
14822 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14823 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14825 case "$getprotoent_r_proto" in
14826 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14827 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14829 case "$getprotoent_r_proto" in
14830 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14831 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14833 case "$getprotoent_r_proto" in
14834 ''|0) d_getprotoent_r=undef
14835 getprotoent_r_proto=0
14836 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14837 * ) case "$getprotoent_r_proto" in
14838 REENTRANT_PROTO*) ;;
14839 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14841 echo "Prototype: $try" ;;
14844 *) case "$usethreads" in
14845 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14847 d_getprotoent_r=undef
14848 getprotoent_r_proto=0
14852 *) getprotoent_r_proto=0
14856 : see if prototypes for various getprotoxxx netdb.h functions are available
14858 set d_getprotoprotos getprotoent $i_netdb netdb.h
14861 : see if getprpwnam exists
14862 set getprpwnam d_getprpwnam
14865 : see if getpwent exists
14866 set getpwent d_getpwent
14869 : see if getpwent_r exists
14870 set getpwent_r d_getpwent_r
14872 case "$d_getpwent_r" in
14874 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14875 case "$d_getpwent_r_proto:$usethreads" in
14876 ":define") d_getpwent_r_proto=define
14877 set d_getpwent_r_proto getpwent_r $hdrs
14881 case "$d_getpwent_r_proto" in
14883 case "$getpwent_r_proto" in
14884 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14885 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14887 case "$getpwent_r_proto" in
14888 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14889 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14891 case "$getpwent_r_proto" in
14892 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14893 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14895 case "$getpwent_r_proto" in
14896 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14897 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14899 case "$getpwent_r_proto" in
14900 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14901 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14903 case "$getpwent_r_proto" in
14904 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14905 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14907 case "$getpwent_r_proto" in
14908 ''|0) d_getpwent_r=undef
14910 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14911 * ) case "$getpwent_r_proto" in
14912 REENTRANT_PROTO*) ;;
14913 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14915 echo "Prototype: $try" ;;
14918 *) case "$usethreads" in
14919 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14926 *) getpwent_r_proto=0
14930 : see if getpwnam_r exists
14931 set getpwnam_r d_getpwnam_r
14933 case "$d_getpwnam_r" in
14935 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14936 case "$d_getpwnam_r_proto:$usethreads" in
14937 ":define") d_getpwnam_r_proto=define
14938 set d_getpwnam_r_proto getpwnam_r $hdrs
14942 case "$d_getpwnam_r_proto" in
14944 case "$getpwnam_r_proto" in
14945 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14946 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14948 case "$getpwnam_r_proto" in
14949 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14950 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14952 case "$getpwnam_r_proto" in
14953 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14954 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14956 case "$getpwnam_r_proto" in
14957 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14958 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14960 case "$getpwnam_r_proto" in
14961 ''|0) d_getpwnam_r=undef
14963 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14964 * ) case "$getpwnam_r_proto" in
14965 REENTRANT_PROTO*) ;;
14966 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14968 echo "Prototype: $try" ;;
14971 *) case "$usethreads" in
14972 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14979 *) getpwnam_r_proto=0
14983 : see if getpwuid_r exists
14984 set getpwuid_r d_getpwuid_r
14986 case "$d_getpwuid_r" in
14988 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14989 case "$d_getpwuid_r_proto:$usethreads" in
14990 ":define") d_getpwuid_r_proto=define
14991 set d_getpwuid_r_proto getpwuid_r $hdrs
14995 case "$d_getpwuid_r_proto" in
14997 case "$getpwuid_r_proto" in
14998 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14999 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15001 case "$getpwuid_r_proto" in
15002 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15003 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15005 case "$getpwuid_r_proto" in
15006 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15007 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15009 case "$getpwuid_r_proto" in
15010 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15011 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15013 case "$getpwuid_r_proto" in
15014 ''|0) d_getpwuid_r=undef
15016 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15017 * ) case "$getpwuid_r_proto" in
15018 REENTRANT_PROTO*) ;;
15019 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15021 echo "Prototype: $try" ;;
15024 *) case "$usethreads" in
15025 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15032 *) getpwuid_r_proto=0
15036 : Optional checks for getsbyname and getsbyport
15038 : see if getservbyname exists
15039 set getservbyname d_getsbyname
15042 : see if getservbyport exists
15043 set getservbyport d_getsbyport
15046 : see if getservent exists
15047 set getservent d_getsent
15050 : see if getservbyname_r exists
15051 set getservbyname_r d_getservbyname_r
15053 case "$d_getservbyname_r" in
15055 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15056 case "$d_getservbyname_r_proto:$usethreads" in
15057 ":define") d_getservbyname_r_proto=define
15058 set d_getservbyname_r_proto getservbyname_r $hdrs
15062 case "$d_getservbyname_r_proto" in
15064 case "$getservbyname_r_proto" in
15065 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15066 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15068 case "$getservbyname_r_proto" in
15069 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15070 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15072 case "$getservbyname_r_proto" in
15073 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15074 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15076 case "$getservbyname_r_proto" in
15077 ''|0) d_getservbyname_r=undef
15078 getservbyname_r_proto=0
15079 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15080 * ) case "$getservbyname_r_proto" in
15081 REENTRANT_PROTO*) ;;
15082 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15084 echo "Prototype: $try" ;;
15087 *) case "$usethreads" in
15088 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15090 d_getservbyname_r=undef
15091 getservbyname_r_proto=0
15095 *) getservbyname_r_proto=0
15099 : see if getservbyport_r exists
15100 set getservbyport_r d_getservbyport_r
15102 case "$d_getservbyport_r" in
15104 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15105 case "$d_getservbyport_r_proto:$usethreads" in
15106 ":define") d_getservbyport_r_proto=define
15107 set d_getservbyport_r_proto getservbyport_r $hdrs
15111 case "$d_getservbyport_r_proto" in
15113 case "$getservbyport_r_proto" in
15114 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15115 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15117 case "$getservbyport_r_proto" in
15118 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15119 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15121 case "$getservbyport_r_proto" in
15122 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15123 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15125 case "$getservbyport_r_proto" in
15126 ''|0) d_getservbyport_r=undef
15127 getservbyport_r_proto=0
15128 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15129 * ) case "$getservbyport_r_proto" in
15130 REENTRANT_PROTO*) ;;
15131 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15133 echo "Prototype: $try" ;;
15136 *) case "$usethreads" in
15137 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15139 d_getservbyport_r=undef
15140 getservbyport_r_proto=0
15144 *) getservbyport_r_proto=0
15148 : see if getservent_r exists
15149 set getservent_r d_getservent_r
15151 case "$d_getservent_r" in
15153 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15154 case "$d_getservent_r_proto:$usethreads" in
15155 ":define") d_getservent_r_proto=define
15156 set d_getservent_r_proto getservent_r $hdrs
15160 case "$d_getservent_r_proto" in
15162 case "$getservent_r_proto" in
15163 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15164 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15166 case "$getservent_r_proto" in
15167 ''|0) try='int getservent_r(struct servent*, char*, int);'
15168 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15170 case "$getservent_r_proto" in
15171 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15172 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15174 case "$getservent_r_proto" in
15175 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15176 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15178 case "$getservent_r_proto" in
15179 ''|0) d_getservent_r=undef
15180 getservent_r_proto=0
15181 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15182 * ) case "$getservent_r_proto" in
15183 REENTRANT_PROTO*) ;;
15184 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15186 echo "Prototype: $try" ;;
15189 *) case "$usethreads" in
15190 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15192 d_getservent_r=undef
15193 getservent_r_proto=0
15197 *) getservent_r_proto=0
15201 : see if prototypes for various getservxxx netdb.h functions are available
15203 set d_getservprotos getservent $i_netdb netdb.h
15206 : see if getspnam exists
15207 set getspnam d_getspnam
15210 : see if this is a shadow.h system
15211 set shadow.h i_shadow
15214 : see if getspnam_r exists
15215 set getspnam_r d_getspnam_r
15217 case "$d_getspnam_r" in
15219 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15220 case "$d_getspnam_r_proto:$usethreads" in
15221 ":define") d_getspnam_r_proto=define
15222 set d_getspnam_r_proto getspnam_r $hdrs
15226 case "$d_getspnam_r_proto" in
15228 case "$getspnam_r_proto" in
15229 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15230 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15232 case "$getspnam_r_proto" in
15233 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15234 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15236 case "$getspnam_r_proto" in
15237 ''|0) d_getspnam_r=undef
15239 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15240 * ) case "$getspnam_r_proto" in
15241 REENTRANT_PROTO*) ;;
15242 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15244 echo "Prototype: $try" ;;
15247 *) case "$usethreads" in
15248 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15255 *) getspnam_r_proto=0
15259 : see if gettimeofday or ftime exists
15260 set gettimeofday d_gettimeod
15262 case "$d_gettimeod" in
15268 val="$undef"; set d_ftime; eval $setvar
15271 case "$d_gettimeod$d_ftime" in
15274 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15278 : see if gmtime_r exists
15279 set gmtime_r d_gmtime_r
15281 case "$d_gmtime_r" in
15283 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15284 case "$d_gmtime_r_proto:$usethreads" in
15285 ":define") d_gmtime_r_proto=define
15286 set d_gmtime_r_proto gmtime_r $hdrs
15290 case "$d_gmtime_r_proto" in
15292 case "$gmtime_r_proto" in
15293 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15294 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15296 case "$gmtime_r_proto" in
15297 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15298 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15300 case "$gmtime_r_proto" in
15301 ''|0) d_gmtime_r=undef
15303 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15304 * ) case "$gmtime_r_proto" in
15305 REENTRANT_PROTO*) ;;
15306 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15308 echo "Prototype: $try" ;;
15311 *) case "$usethreads" in
15312 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15319 *) gmtime_r_proto=0
15323 : see if hasmntopt exists
15324 set hasmntopt d_hasmntopt
15327 : see if this is a netinet/in.h or sys/in.h system
15328 set netinet/in.h i_niin sys/in.h i_sysin
15331 : see if arpa/inet.h has to be included
15332 set arpa/inet.h i_arpainet
15335 : see if htonl --and friends-- exists
15340 : Maybe they are macros.
15343 $cat >htonl.c <<EOM
15345 #include <sys/types.h>
15346 #$i_niin I_NETINET_IN
15348 #$i_arpainet I_ARPA_INET
15349 #ifdef I_NETINET_IN
15350 #include <netinet/in.h>
15353 #include <sys/in.h>
15356 #include <arpa/inet.h>
15359 printf("Defined as a macro.");
15362 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15363 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15365 echo "But it seems to be defined as a macro." >&4
15373 : see if ilogbl exists
15374 set ilogbl d_ilogbl
15379 if set index val -f; eval $csym; $val; then
15380 if set strchr val -f d_strchr; eval $csym; $val; then
15381 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15384 echo "strchr() found." >&4
15388 echo "index() found." >&4
15393 echo "index() found." >&4
15396 if set strchr val -f d_strchr; eval $csym; $val; then
15399 echo "strchr() found." >&4
15401 echo "No index() or strchr() found!" >&4
15406 set d_strchr; eval $setvar
15408 set d_index; eval $setvar
15410 : check whether inet_aton exists
15411 set inet_aton d_inetaton
15414 : see if inet_ntop exists
15415 set inet_ntop d_inetntop
15418 : see if inet_pton exists
15419 set inet_pton d_inetpton
15424 $cat >isascii.c <<EOCP
15427 #$i_stdlib I_STDLIB
15429 #include <stdlib.h>
15440 if eval $compile; then
15441 echo "isascii() found." >&4
15444 echo "isascii() NOT found." >&4
15453 $cat >isblank.c <<'EOCP'
15464 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15465 echo "isblank() found." >&4
15468 echo "isblank() NOT found." >&4
15475 : see if isfinitel exists
15476 set isfinitel d_isfinitel
15479 : see if isinfl exists
15480 set isinfl d_isinfl
15483 : see if isnanl exists
15484 set isnanl d_isnanl
15491 : see if j0l exists
15495 : see if killpg exists
15496 set killpg d_killpg
15499 : see if lchown exists
15501 $cat > try.c <<'EOCP'
15502 /* System header to define __stub macros and hopefully few prototypes,
15503 which can conflict with char lchown(); below. */
15504 #include <assert.h>
15505 /* Override any gcc2 internal prototype to avoid an error. */
15506 /* We use char because int might match the return type of a gcc2
15507 builtin and then its argument prototype would still apply. */
15510 /* The GNU C library defines this for functions which it implements
15511 to always fail with ENOSYS. Some functions are actually named
15512 something starting with __ and the normal name is an alias. */
15513 #if defined (__stub_lchown) || defined (__stub___lchown)
15521 if eval $compile; then
15522 $echo "lchown() found." >&4
15525 $echo "lchown() NOT found." >&4
15531 : See if number of significant digits in a double precision number is known
15533 $cat >ldbl_dig.c <<EOM
15534 #$i_limits I_LIMITS
15537 #include <limits.h>
15543 printf("Contains LDBL_DIG");
15546 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15547 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15548 echo "LDBL_DIG found." >&4
15551 echo "LDBL_DIG NOT found." >&4
15558 : see if this is a math.h system
15562 : check to see if math.h defines _LIB_VERSION
15563 d_libm_lib_version="$undef"
15567 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15569 #include <unistd.h>
15571 int main (int argc, char *argv[])
15573 printf ("%d\n", _LIB_VERSION);
15578 if eval $compile; then
15580 echo "Yes, it does ($foo)" >&4
15581 d_libm_lib_version="$define"
15583 echo "No, it does not (probably harmless)" >&4
15590 : check for fpclassify
15592 echo "Checking to see if you have fpclassify..." >&4
15598 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
15601 if eval $compile; then
15603 echo "You have fpclassify."
15606 echo "You do not have fpclassify."
15612 : check for isfinite
15614 echo "Checking to see if you have isfinite..." >&4
15620 int main() { return isfinite(0.0); }
15623 if eval $compile; then
15625 echo "You have isfinite."
15628 echo "You do not have isfinite."
15636 echo "Checking to see if you have isinf..." >&4
15642 int main() { return isinf(0.0); }
15645 if eval $compile; then
15647 echo "You have isinf."
15650 echo "You do not have isinf."
15658 echo "Checking to see if you have isnan..." >&4
15664 int main() { return isnan(0.0); }
15667 if eval $compile; then
15669 echo "You have isnan."
15672 echo "You do not have isnan."
15678 : see if link exists
15682 : see if localtime_r exists
15683 set localtime_r d_localtime_r
15685 case "$d_localtime_r" in
15687 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15688 case "$d_localtime_r_proto:$usethreads" in
15689 ":define") d_localtime_r_proto=define
15690 set d_localtime_r_proto localtime_r $hdrs
15694 case "$d_localtime_r_proto" in
15696 case "$localtime_r_proto" in
15697 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15698 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15700 case "$localtime_r_proto" in
15701 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15702 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15704 case "$localtime_r_proto" in
15705 ''|0) d_localtime_r=undef
15706 localtime_r_proto=0
15707 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15708 * ) case "$localtime_r_proto" in
15709 REENTRANT_PROTO*) ;;
15710 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15712 echo "Prototype: $try" ;;
15715 *) case "$usethreads" in
15716 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15718 d_localtime_r=undef
15719 localtime_r_proto=0
15723 *) localtime_r_proto=0
15727 : see if localtime_r calls tzset
15728 case "$localtime_r_proto" in
15731 /* Does our libc's localtime_r call tzset ?
15732 * return 0 if so, 1 otherwise.
15734 #$i_systypes I_SYS_TYPES
15735 #$i_unistd I_UNISTD
15737 #$i_stdlib I_STDLIB
15738 #$i_string I_STRING
15739 #$i_malloc I_MALLOC
15741 # include <sys/types.h>
15744 # include <unistd.h>
15750 #include <stdlib.h>
15753 # include <string.h>
15755 # include <strings.h>
15758 # include <malloc.h>
15762 time_t t = time(0L);
15763 char w_tz[]="TZ" "=GMT+5",
15764 e_tz[]="TZ" "=GMT-5",
15765 *tz_e = (char*)malloc(16),
15766 *tz_w = (char*)malloc(16);
15767 struct tm tm_e, tm_w;
15768 memset(&tm_e,'\0',sizeof(struct tm));
15769 memset(&tm_w,'\0',sizeof(struct tm));
15774 localtime_r(&t, &tm_e);
15777 localtime_r(&t, &tm_w);
15779 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15785 if eval $compile; then
15786 if $run ./try; then
15787 d_localtime_r_needs_tzset=undef;
15789 d_localtime_r_needs_tzset=define;
15792 d_localtime_r_needs_tzset=undef;
15796 d_localtime_r_needs_tzset=undef;
15801 : see if localeconv exists
15802 set localeconv d_locconv
15805 : see if lockf exists
15809 : see if prototype for lseek is available
15811 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15814 : see if lstat exists
15818 : see if madvise exists
15819 set madvise d_madvise
15822 : see if malloc_size exists
15823 set malloc_size d_malloc_size
15826 : see if malloc_size_good exists
15827 set malloc_good_size d_malloc_good_size
15830 : see if mblen exists
15834 : see if mbstowcs exists
15835 set mbstowcs d_mbstowcs
15838 : see if mbtowc exists
15839 set mbtowc d_mbtowc
15842 : see if memchr exists
15843 set memchr d_memchr
15846 : see if memcmp exists
15847 set memcmp d_memcmp
15850 : see if memcpy exists
15851 set memcpy d_memcpy
15854 : see if memmove exists
15855 set memmove d_memmove
15858 : see if memset exists
15859 set memset d_memset
15862 : see if mkdir exists
15866 : see if mkdtemp exists
15867 set mkdtemp d_mkdtemp
15870 : see if mkfifo exists
15871 set mkfifo d_mkfifo
15874 : see if mkstemp exists
15875 set mkstemp d_mkstemp
15878 : see if mkstemps exists
15879 set mkstemps d_mkstemps
15882 : see if mktime exists
15883 set mktime d_mktime
15886 : see if this is a sys/mman.h system
15887 set sys/mman.h i_sysmman
15890 : see if mmap exists
15893 : see what shmat returns
15894 : default to something harmless
15896 case "$i_sysmman$d_mmap" in
15898 $cat >mmap.c <<'END'
15899 #include <sys/mman.h>
15902 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15907 echo "and it returns ($mmaptype)." >&4
15913 : see if sqrtl exists
15917 : see if scalbnl exists
15918 set scalbnl d_scalbnl
15921 : see if modfl exists
15925 : see if prototype for modfl is available
15927 set d_modflproto modfl $i_math math.h
15930 d_modfl_pow32_bug="$undef"
15932 case "$d_longdbl$d_modfl" in
15935 Checking to see whether your modfl() is okay for large values...
15941 if $test "X$d_modflproto" != "X$define"; then
15942 $cat >>try.c <<EOCP
15943 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15944 long double modfl (long double, long double *);
15947 $cat >>try.c <<EOCP
15949 long double nv = 4294967303.15;
15955 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15959 case "$osname:$gccversion" in
15960 aix:) saveccflags="$ccflags"
15961 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15964 if eval $compile; then
15967 *" 4294967303.150000 1.150000 4294967302.000000")
15968 echo >&4 "Your modfl() is broken for large values."
15969 d_modfl_pow32_bug="$define"
15971 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15975 *" 4294967303.150000 0.150000 4294967303.000000")
15976 echo >&4 "Your modfl() seems okay for large values."
15978 *) echo >&4 "I don't understand your modfl() at all."
15984 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15987 case "$osname:$gccversion" in
15988 aix:) ccflags="$saveccflags" ;; # restore
15993 if $test "$uselongdouble" = "$define"; then
15995 if $test "$d_sqrtl" != "$define"; then
15996 message="$message sqrtl"
15998 if $test "$d_modfl" != "$define"; then
15999 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16000 echo "You have both aintl and copysignl, so I can emulate modfl."
16002 message="$message modfl"
16005 if $test "$d_frexpl" != "$define"; then
16006 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16007 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16009 message="$message frexpl"
16012 if $test "$d_ldexpl" != "$define"; then
16013 message="$message ldexpl"
16016 if $test "$message" != ""; then
16019 *** You requested the use of long doubles but you do not seem to have
16020 *** the following mathematical functions needed for long double support:
16022 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16023 *** Cannot continue, aborting.
16031 : see if mprotect exists
16032 set mprotect d_mprotect
16035 : see if msgctl exists
16036 set msgctl d_msgctl
16039 : see if msgget exists
16040 set msgget d_msgget
16043 : see if msgsnd exists
16044 set msgsnd d_msgsnd
16047 : see if msgrcv exists
16048 set msgrcv d_msgrcv
16051 : see how much of the 'msg*(2)' library is present.
16054 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16055 *"$undef"*) h_msg=false;;
16059 case "`ipcs 2>&1`" in
16060 "SVID messages"*"not configured"*)
16061 echo "Your $osname does not have the msg*(2) configured." >&4
16064 set msgctl d_msgctl
16066 set msgget d_msgget
16068 set msgsnd d_msgsnd
16070 set msgrcv d_msgrcv
16076 : we could also check for sys/ipc.h ...
16077 if $h_msg && $test `./findhdr sys/msg.h`; then
16078 echo "You have the full msg*(2) library." >&4
16081 echo "You don't have the full msg*(2) library." >&4
16087 : Check for msghdr_s
16089 echo "Checking to see if your system supports struct msghdr..." >&4
16090 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16092 case "$d_msghdr_s" in
16093 "$define") echo "Yes, it does." ;;
16094 *) echo "No, it doesn't." ;;
16098 : see if msync exists
16102 : see if munmap exists
16103 set munmap d_munmap
16106 : see if nice exists
16110 : see if this is a langinfo.h system
16111 set langinfo.h i_langinfo
16114 : see if nl_langinfo exists
16115 set nl_langinfo d_nl_langinfo
16118 : check for volatile keyword
16120 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16121 $cat >try.c <<'EOCP'
16124 typedef struct _goo_struct goo_struct;
16125 goo_struct * volatile goo = ((goo_struct *)0);
16126 struct _goo_struct {
16131 typedef unsigned short foo_t;
16132 char *volatile foo;
16134 volatile foo_t blech;
16138 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16140 echo "Yup, it does."
16143 echo "Nope, it doesn't."
16149 : Check basic sizes
16151 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16153 case "$use64bitint:$d_quad:$quadtype" in
16156 uvtype="$uquadtype"
16161 uvtype="unsigned long"
16167 case "$uselongdouble:$d_longdbl" in
16169 nvtype="long double"
16170 nvsize=$longdblsize
16177 $echo "(IV will be "$ivtype", $ivsize bytes)"
16178 $echo "(UV will be "$uvtype", $uvsize bytes)"
16179 $echo "(NV will be "$nvtype", $nvsize bytes)"
16182 #$i_inttypes I_INTTYPES
16184 #include <inttypes.h>
16189 int8_t i = INT8_MAX;
16190 uint8_t u = UINT8_MAX;
16191 printf("int8_t\n");
16194 int16_t i = INT16_MAX;
16195 uint16_t u = UINT16_MAX;
16196 printf("int16_t\n");
16199 int32_t i = INT32_MAX;
16200 uint32_t u = UINT32_MAX;
16201 printf("int32_t\n");
16206 i8type="signed char"
16207 u8type="unsigned char"
16212 '') case "$shortsize" in
16214 u16type="unsigned short"
16222 '') set try -DINT16
16223 if eval $compile; then
16224 case "`$run ./try`" in
16236 '') if $test $shortsize -ge 2; then
16238 u16type="unsigned short"
16246 '') case "$longsize" in
16248 u32type="unsigned long"
16252 *) case "$intsize" in
16254 u32type="unsigned int"
16264 '') set try -DINT32
16265 if eval $compile; then
16266 case "`$run ./try`" in
16278 '') if $test $intsize -ge 4; then
16280 u32type="unsigned int"
16288 '') case "$d_quad:$quadtype" in
16290 i64type="$quadtype"
16291 u64type="$uquadtype"
16299 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16300 : volatile so that the compiler has to store it out to memory.
16301 if test X"$d_volatile" = X"$define"; then
16306 #$i_stdlib I_STDLIB
16308 #include <stdlib.h>
16310 #include <sys/types.h>
16311 #include <signal.h>
16313 $volatile int bletched = 0;
16314 $signal_t blech(int s) { bletched = 1; }
16319 int n = 8 * $uvsize;
16322 signal(SIGFPE, blech);
16325 for (i = 0; i < n; i++) {
16326 u = u << 1 | ($uvtype)1;
16328 if (($uvtype)d != u)
16332 d = ($nvtype)(u - 1);
16333 if (($uvtype)d != (u - 1))
16340 printf("%d\n", ((i == n) ? -n : i));
16346 d_nv_preserves_uv="$undef"
16347 if eval $compile; then
16348 nv_preserves_uv_bits="`$run ./try`"
16350 case "$nv_preserves_uv_bits" in
16352 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16353 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16354 d_nv_preserves_uv="$define"
16356 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16357 d_nv_preserves_uv="$undef" ;;
16358 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16359 nv_preserves_uv_bits="0" ;;
16363 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16364 : volatile so that the compiler has to store it out to memory.
16365 if test X"$d_volatile" = X"$define"; then
16371 typedef $nvtype NV;
16378 while(count < 256) {
16379 $volatile NV up = value + 1.0;
16380 $volatile NV negated = -value;
16381 $volatile NV down = negated - 1.0;
16382 $volatile NV got_up = up - value;
16383 int up_good = got_up == 1.0;
16384 int got_down = down - negated;
16385 int down_good = got_down == -1.0;
16387 if (down_good != up_good) {
16389 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16390 up_good, (double) got_up, down_good, (double) got_down,
16391 count, (double) value);
16398 fputs("256.0", stdout);
16401 fputs("2.0", stdout);
16407 fputs("*", stdout);
16413 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16414 count, (double) value);
16420 nv_overflows_integers_at='0'
16421 if eval $compile; then
16427 The largest integer your NVs can preserve is equal to $xxx
16429 nv_overflows_integers_at="$xxx"
16432 Cannot determine the largest integer value your NVs can hold, unexpected output
16439 Cannot determine the largest integer value your NVs can hold
16446 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16447 : volatile so that the compiler has to store it out to memory.
16448 if test X"$d_volatile" = X"$define"; then
16453 #$i_stdlib I_STDLIB
16455 #include <stdlib.h>
16457 #$i_string I_STRING
16459 # include <string.h>
16461 # include <strings.h>
16463 #include <sys/types.h>
16464 #include <signal.h>
16466 $volatile int bletched = 0;
16467 $signal_t blech(int s) { bletched = 1; }
16470 int checkit($nvtype d, char *where) {
16471 unsigned char *p = (char *)&d;
16472 unsigned char *end = p + sizeof(d);
16482 printf("No - %s: 0x", where);
16484 printf ("%02X", *p++);
16489 int main(int argc, char **argv) {
16492 fail += checkit(d, "0.0");
16494 /* The compiler shouldn't be assuming that bletched is 0 */
16497 fail += checkit(d, "bleched");
16500 signal(SIGFPE, blech);
16503 /* Paranoia - the compiler should have no way of knowing that ANSI says
16504 that argv[argc] will always be NULL. Actually, if it did assume this it
16505 would be buggy, as this is C and main() can be called from elsewhere in
16507 d = argv[argc] ? 1 : 0;
16510 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16513 fail += checkit(d, "ternary");
16515 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16518 printf("No - memset doesn't give 0.0\n");
16519 /* This might just blow up: */
16520 printf("(gives %g)\n", d);
16526 printf("No - something bleched\n");
16531 printf("No - %d fail(s)\n", fail);
16540 d_nv_zero_is_allbits_zero="$undef"
16541 if eval $compile; then
16547 0.0 is represented as all bits zero in memory
16549 d_nv_zero_is_allbits_zero="$define"
16552 0.0 is not represented as all bits zero in memory
16554 d_nv_zero_is_allbits_zero="$undef"
16559 0.0 is not represented as all bits zero in memory
16561 d_nv_zero_is_allbits_zero="$undef"
16567 : check for off64_t
16569 echo "Checking to see if you have off64_t..." >&4
16571 #include <sys/types.h>
16572 #include <unistd.h>
16573 int main() { off64_t x = 7; }
16576 if eval $compile; then
16578 echo "You have off64_t."
16581 echo "You do not have off64_t."
16582 case "$lseeksize" in
16583 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16590 : how to create joinable pthreads
16591 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16593 echo "Checking what constant to use for creating joinable pthreads..." >&4
16594 $cat >try.c <<'EOCP'
16595 #include <pthread.h>
16597 int detachstate = JOINABLE;
16600 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16601 if eval $compile; then
16602 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16603 val="$undef" # Yes, undef.
16604 set d_old_pthread_create_joinable
16607 set old_pthread_create_joinable
16610 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16611 if eval $compile; then
16612 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16614 set d_old_pthread_create_joinable
16616 val=PTHREAD_CREATE_UNDETACHED
16617 set old_pthread_create_joinable
16620 set try -DJOINABLE=__UNDETACHED
16621 if eval $compile; then
16622 echo "You seem to use __UNDETACHED." >&4
16624 set d_old_pthread_create_joinable
16627 set old_pthread_create_joinable
16630 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16632 set d_old_pthread_create_joinable
16635 set old_pthread_create_joinable
16642 d_old_pthread_create_joinable="$undef"
16643 old_pthread_create_joinable=""
16646 : see if pause exists
16650 : see if poll exists
16654 : see if prctl exists
16658 : see if prctl supports PR_SET_NAME
16659 d_prctl_set_name=$undef
16664 #include <unistd.h>
16666 #include <sys/prctl.h>
16668 int main (int argc, char *argv[])
16670 return (prctl (PR_SET_NAME, "Test"));
16674 if eval $compile_ok && $run ./try; then
16675 echo "Your prctl (PR_SET_NAME, ...) works"
16676 d_prctl_set_name=$define
16682 : see if readlink exists
16683 set readlink d_readlink
16686 : Check if exe is symlink to abs path of executing program
16690 case "$d_readlink" in
16692 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16693 : more tidy to avoid an extra level of symlink
16694 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16695 while test $# -gt 0; do
16698 if $issymlink $try; then
16699 $ls -l $try > reflect
16700 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16701 echo "You have $type-like $try."
16702 procselfexe='"'$try'"'
16704 : This will break out of the loop
16715 : backward compatibility for d_hvfork
16716 if test X$d_hvfork != X; then
16717 d_vfork="$d_hvfork"
16720 : see if there is a vfork
16725 d_pseudofork=$undef
16727 : Ok, but do we want to use it. vfork is reportedly unreliable in
16728 : perl on Solaris 2.x, and probably elsewhere.
16732 case "$usevfork" in
16738 Perl can only use a vfork() that doesn't suffer from strict
16739 restrictions on calling functions or modifying global data in
16740 the child. For example, glibc-2.1 contains such a vfork()
16741 that is unsuitable. If your system provides a proper fork()
16742 call, chances are that you do NOT want perl to use vfork().
16745 rp="Do you still want to use vfork()?"
16750 echo "Ok, we won't use vfork()."
16759 $define) usevfork='true';;
16760 *) usevfork='false';;
16763 : see whether the pthread_atfork exists
16765 #include <pthread.h>
16768 #ifdef PTHREAD_ATFORK
16769 pthread_atfork(NULL,NULL,NULL);
16774 : see if pthread_atfork exists
16775 set try -DPTHREAD_ATFORK
16776 if eval $compile; then
16781 case "$usethreads" in
16784 $define) echo 'pthread_atfork found.' >&4 ;;
16785 *) echo 'pthread_atfork NOT found.' >&4 ;;
16788 set d_pthread_atfork
16791 : see if pthread_attr_setscope exists
16792 set pthread_attr_setscope d_pthread_attr_setscope
16795 : see whether the various POSIXish _yields exist
16797 #include <pthread.h>
16803 #ifdef PTHREAD_YIELD
16806 #ifdef PTHREAD_YIELD_NULL
16807 pthread_yield(NULL);
16813 : see if sched_yield exists
16814 set try -DSCHED_YIELD
16815 if eval $compile; then
16817 sched_yield='sched_yield()'
16821 case "$usethreads" in
16824 $define) echo 'sched_yield() found.' >&4 ;;
16825 *) echo 'sched_yield() NOT found.' >&4 ;;
16831 : see if pthread_yield exists
16832 set try -DPTHREAD_YIELD
16833 if eval $compile; then
16835 case "$sched_yield" in
16836 '') sched_yield='pthread_yield()' ;;
16839 set try -DPTHREAD_YIELD_NULL
16840 if eval $compile; then
16842 case "$sched_yield" in
16843 '') sched_yield='pthread_yield(NULL)' ;;
16849 case "$usethreads" in
16852 $define) echo 'pthread_yield() found.' >&4 ;;
16853 *) echo 'pthread_yield() NOT found.' >&4 ;;
16857 set d_pthread_yield
16859 case "$sched_yield" in
16860 '') sched_yield=undef ;;
16864 : check for ptrdiff_t
16866 echo "Checking to see if you have ptrdiff_t..." >&4
16868 #include <stddef.h>
16869 int main() { ptrdiff_t x = 7; }
16872 if eval $compile; then
16874 echo "You have ptrdiff_t."
16877 echo "You do not have ptrdiff_t."
16883 : see if random_r exists
16884 set random_r d_random_r
16886 case "$d_random_r" in
16888 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16889 case "$d_random_r_proto:$usethreads" in
16890 ":define") d_random_r_proto=define
16891 set d_random_r_proto random_r $hdrs
16895 case "$d_random_r_proto" in
16897 case "$random_r_proto" in
16898 ''|0) try='int random_r(int*, struct random_data*);'
16899 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16901 case "$random_r_proto" in
16902 ''|0) try='int random_r(long*, struct random_data*);'
16903 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16905 case "$random_r_proto" in
16906 ''|0) try='int random_r(struct random_data*, int32_t*);'
16907 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16909 case "$random_r_proto" in
16910 ''|0) d_random_r=undef
16912 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16913 * ) case "$random_r_proto" in
16914 REENTRANT_PROTO*) ;;
16915 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16917 echo "Prototype: $try" ;;
16920 *) case "$usethreads" in
16921 define) echo "random_r has no prototype, not using it." >&4 ;;
16928 *) random_r_proto=0
16932 : see if readdir and friends exist
16933 set readdir d_readdir
16935 set seekdir d_seekdir
16937 set telldir d_telldir
16939 set rewinddir d_rewinddir
16942 : see if readdir64_r exists
16943 set readdir64_r d_readdir64_r
16945 case "$d_readdir64_r" in
16947 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16948 case "$d_readdir64_r_proto:$usethreads" in
16949 ":define") d_readdir64_r_proto=define
16950 set d_readdir64_r_proto readdir64_r $hdrs
16954 case "$d_readdir64_r_proto" in
16956 case "$readdir64_r_proto" in
16957 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16958 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16960 case "$readdir64_r_proto" in
16961 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16962 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16964 case "$readdir64_r_proto" in
16965 ''|0) d_readdir64_r=undef
16966 readdir64_r_proto=0
16967 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16968 * ) case "$readdir64_r_proto" in
16969 REENTRANT_PROTO*) ;;
16970 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16972 echo "Prototype: $try" ;;
16975 *) case "$usethreads" in
16976 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16978 d_readdir64_r=undef
16979 readdir64_r_proto=0
16983 *) readdir64_r_proto=0
16987 : see if readdir_r exists
16988 set readdir_r d_readdir_r
16990 case "$d_readdir_r" in
16992 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16993 case "$d_readdir_r_proto:$usethreads" in
16994 ":define") d_readdir_r_proto=define
16995 set d_readdir_r_proto readdir_r $hdrs
16999 case "$d_readdir_r_proto" in
17001 case "$readdir_r_proto" in
17002 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17003 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17005 case "$readdir_r_proto" in
17006 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17007 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17009 case "$readdir_r_proto" in
17010 ''|0) d_readdir_r=undef
17012 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17013 * ) case "$readdir_r_proto" in
17014 REENTRANT_PROTO*) ;;
17015 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17017 echo "Prototype: $try" ;;
17020 *) case "$usethreads" in
17021 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17028 *) readdir_r_proto=0
17032 : see if readv exists
17036 : see if recvmsg exists
17037 set recvmsg d_recvmsg
17040 : see if rename exists
17041 set rename d_rename
17044 : see if rmdir exists
17048 : see if memory.h is available.
17053 : See if it conflicts with string.h
17059 $cppstdin $cppflags $cppminus < $strings > mem.h
17060 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17062 echo "We won't be including <memory.h>."
17072 : can bcopy handle overlapping blocks?
17075 case "$d_memmove" in
17076 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17077 *) case "$d_bcopy" in
17079 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17081 #$i_memory I_MEMORY
17082 #$i_stdlib I_STDLIB
17083 #$i_string I_STRING
17084 #$i_unistd I_UNISTD
17086 $cat >>try.c <<'EOCP'
17089 # include <memory.h>
17092 # include <stdlib.h>
17095 # include <string.h>
17097 # include <strings.h>
17100 # include <unistd.h> /* Needed for NetBSD */
17104 char buf[128], abc[128];
17110 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17111 try to store the string in read-only memory. */
17112 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17114 for (align = 7; align >= 0; align--) {
17115 for (len = 36; len; len--) {
17117 bcopy(abc, b, len);
17118 for (off = 1; off <= len; off++) {
17119 bcopy(b, b+off, len);
17120 bcopy(b+off, b, len);
17121 if (bcmp(b, abc, len))
17130 if eval $compile_ok; then
17131 if $run ./try 2>/dev/null; then
17132 echo "Yes, it can."
17135 echo "It can't, sorry."
17138 echo "(I can't compile the test program, so we'll assume not...)"
17148 : can memcpy handle overlapping blocks?
17151 case "$d_memmove" in
17152 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17153 *) case "$d_memcpy" in
17155 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17157 #$i_memory I_MEMORY
17158 #$i_stdlib I_STDLIB
17159 #$i_string I_STRING
17160 #$i_unistd I_UNISTD
17162 $cat >>try.c <<'EOCP'
17165 # include <memory.h>
17168 # include <stdlib.h>
17171 # include <string.h>
17173 # include <strings.h>
17176 # include <unistd.h> /* Needed for NetBSD */
17180 char buf[128], abc[128];
17186 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17187 try to store the string in read-only memory. */
17188 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17190 for (align = 7; align >= 0; align--) {
17191 for (len = 36; len; len--) {
17193 memcpy(b, abc, len);
17194 for (off = 1; off <= len; off++) {
17195 memcpy(b+off, b, len);
17196 memcpy(b, b+off, len);
17197 if (memcmp(b, abc, len))
17206 if eval $compile_ok; then
17207 if $run ./try 2>/dev/null; then
17208 echo "Yes, it can."
17211 echo "It can't, sorry."
17214 echo "(I can't compile the test program, so we'll assume not...)"
17224 : can memcmp be trusted to compare relative magnitude?
17226 case "$d_memcmp" in
17229 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17231 #$i_memory I_MEMORY
17232 #$i_stdlib I_STDLIB
17233 #$i_string I_STRING
17234 #$i_unistd I_UNISTD
17236 $cat >>try.c <<'EOCP'
17239 # include <memory.h>
17242 # include <stdlib.h>
17245 # include <string.h>
17247 # include <strings.h>
17250 # include <unistd.h> /* Needed for NetBSD */
17256 if ((a < b) && memcmp(&a, &b, 1) < 0)
17262 if eval $compile_ok; then
17263 if $run ./try 2>/dev/null; then
17264 echo "Yes, it can."
17267 echo "No, it can't (it uses signed chars)."
17270 echo "(I can't compile the test program, so we'll assume not...)"
17278 : see if prototype for sbrk is available
17280 set d_sbrkproto sbrk $i_unistd unistd.h
17283 : see if select exists
17284 set select d_select
17287 : see if semctl exists
17288 set semctl d_semctl
17291 : see if semget exists
17292 set semget d_semget
17295 : see if semop exists
17299 : see how much of the 'sem*(2)' library is present.
17302 case "$d_semctl$d_semget$d_semop" in
17303 *"$undef"*) h_sem=false;;
17307 case "`ipcs 2>&1`" in
17308 "SVID messages"*"not configured"*)
17309 echo "Your $osname does not have the sem*(2) configured." >&4
17312 set semctl d_semctl
17314 set semget d_semget
17322 : we could also check for sys/ipc.h ...
17323 if $h_sem && $test `./findhdr sys/sem.h`; then
17324 echo "You have the full sem*(2) library." >&4
17327 echo "You don't have the full sem*(2) library." >&4
17333 : see whether sys/sem.h defines union semun
17335 $cat > try.c <<'END'
17336 #include <sys/types.h>
17337 #include <sys/ipc.h>
17338 #include <sys/sem.h>
17339 int main () { union semun semun; semun.buf = 0; }
17342 if eval $compile; then
17343 echo "You have union semun in <sys/sem.h>." >&4
17346 echo "You do not have union semun in <sys/sem.h>." >&4
17353 : see how to do semctl IPC_STAT
17357 $cat > tryh.h <<END
17360 # define S_IRUSR S_IREAD
17361 # define S_IWUSR S_IWRITE
17362 # define S_IXUSR S_IEXEC
17364 # define S_IRUSR 0400
17365 # define S_IWUSR 0200
17366 # define S_IXUSR 0100
17368 # define S_IRGRP (S_IRUSR>>3)
17369 # define S_IWGRP (S_IWUSR>>3)
17370 # define S_IXGRP (S_IXUSR>>3)
17371 # define S_IROTH (S_IRUSR>>6)
17372 # define S_IWOTH (S_IWUSR>>6)
17373 # define S_IXOTH (S_IXUSR>>6)
17376 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17377 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17378 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17381 : see whether semctl IPC_STAT can use union semun
17382 case "$d_semctl_semun" in
17386 #include <sys/types.h>
17387 #include <sys/ipc.h>
17388 #include <sys/sem.h>
17389 #include <sys/stat.h>
17396 #$d_union_semun HAS_UNION_SEMUN
17399 #ifndef HAS_UNION_SEMUN
17402 struct semid_ds *buf;
17403 unsigned short *array;
17409 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17410 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17412 struct semid_ds argbuf;
17415 st = semctl(sem, 0, IPC_STAT, arg);
17419 # endif /* IPC_STAT */
17420 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17422 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17423 # endif /* IPC_RMID */
17424 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17426 #endif /* IPC_PRIVATE && ... */
17427 printf("semget failed: errno = %d\n", errno);
17432 if eval $compile; then
17435 semun) val="$define" ;;
17443 case "$d_semctl_semun" in
17445 echo "You can use union semun for semctl IPC_STAT." >&4
17448 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17453 : see whether semctl IPC_STAT can use struct semid_ds pointer
17454 case "$d_semctl_semid_ds" in
17457 $cat > try.c <<'END'
17458 #include <sys/types.h>
17459 #include <sys/ipc.h>
17460 #include <sys/sem.h>
17461 #include <sys/stat.h>
17469 struct semid_ds arg;
17472 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17473 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17476 st = semctl(sem, 0, IPC_STAT, &arg);
17478 printf("semid_ds\n");
17480 # endif /* IPC_STAT */
17481 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17483 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17484 # endif /* IPC_RMID */
17485 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17487 #endif /* IPC_PRIVATE && ... */
17488 printf("semget failed: errno = %d\n", errno);
17494 if eval $compile; then
17497 semid_ds) val="$define" ;;
17501 set d_semctl_semid_ds
17505 case "$d_semctl_semid_ds" in
17507 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17509 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17515 # We do not have the full sem*(2) library, so assume we can not
17521 set d_semctl_semid_ds
17527 : see if sendmsg exists
17528 set sendmsg d_sendmsg
17531 : see if setegid exists
17532 set setegid d_setegid
17535 : see if seteuid exists
17536 set seteuid d_seteuid
17539 : see if setgrent exists
17540 set setgrent d_setgrent
17543 : see if setgrent_r exists
17544 set setgrent_r d_setgrent_r
17546 case "$d_setgrent_r" in
17548 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17549 case "$d_setgrent_r_proto:$usethreads" in
17550 ":define") d_setgrent_r_proto=define
17551 set d_setgrent_r_proto setgrent_r $hdrs
17555 case "$d_setgrent_r_proto" in
17557 case "$setgrent_r_proto" in
17558 ''|0) try='int setgrent_r(FILE**);'
17559 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17561 case "$setgrent_r_proto" in
17562 ''|0) try='void setgrent_r(FILE**);'
17563 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17565 case "$setgrent_r_proto" in
17566 ''|0) d_setgrent_r=undef
17568 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17569 * ) case "$setgrent_r_proto" in
17570 REENTRANT_PROTO*) ;;
17571 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17573 echo "Prototype: $try" ;;
17576 *) case "$usethreads" in
17577 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17584 *) setgrent_r_proto=0
17588 : see if sethostent exists
17589 set sethostent d_sethent
17592 : see if sethostent_r exists
17593 set sethostent_r d_sethostent_r
17595 case "$d_sethostent_r" in
17597 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17598 case "$d_sethostent_r_proto:$usethreads" in
17599 ":define") d_sethostent_r_proto=define
17600 set d_sethostent_r_proto sethostent_r $hdrs
17604 case "$d_sethostent_r_proto" in
17606 case "$sethostent_r_proto" in
17607 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17608 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17610 case "$sethostent_r_proto" in
17611 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17612 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17614 case "$sethostent_r_proto" in
17615 ''|0) d_sethostent_r=undef
17616 sethostent_r_proto=0
17617 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17618 * ) case "$sethostent_r_proto" in
17619 REENTRANT_PROTO*) ;;
17620 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17622 echo "Prototype: $try" ;;
17625 *) case "$usethreads" in
17626 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17628 d_sethostent_r=undef
17629 sethostent_r_proto=0
17633 *) sethostent_r_proto=0
17637 : see if setitimer exists
17638 set setitimer d_setitimer
17641 : see if setlinebuf exists
17642 set setlinebuf d_setlinebuf
17645 : see if setlocale exists
17646 set setlocale d_setlocale
17649 : see if locale.h is available
17650 set locale.h i_locale
17653 : see if setlocale_r exists
17654 set setlocale_r d_setlocale_r
17656 case "$d_setlocale_r" in
17658 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17659 case "$d_setlocale_r_proto:$usethreads" in
17660 ":define") d_setlocale_r_proto=define
17661 set d_setlocale_r_proto setlocale_r $hdrs
17665 case "$d_setlocale_r_proto" in
17667 case "$setlocale_r_proto" in
17668 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17669 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17671 case "$setlocale_r_proto" in
17672 ''|0) d_setlocale_r=undef
17673 setlocale_r_proto=0
17674 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17675 * ) case "$setlocale_r_proto" in
17676 REENTRANT_PROTO*) ;;
17677 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17679 echo "Prototype: $try" ;;
17682 *) case "$usethreads" in
17683 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17685 d_setlocale_r=undef
17686 setlocale_r_proto=0
17690 *) setlocale_r_proto=0
17694 : see if setnetent exists
17695 set setnetent d_setnent
17698 : see if setnetent_r exists
17699 set setnetent_r d_setnetent_r
17701 case "$d_setnetent_r" in
17703 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17704 case "$d_setnetent_r_proto:$usethreads" in
17705 ":define") d_setnetent_r_proto=define
17706 set d_setnetent_r_proto setnetent_r $hdrs
17710 case "$d_setnetent_r_proto" in
17712 case "$setnetent_r_proto" in
17713 ''|0) try='int setnetent_r(int, struct netent_data*);'
17714 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17716 case "$setnetent_r_proto" in
17717 ''|0) try='void setnetent_r(int, struct netent_data*);'
17718 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17720 case "$setnetent_r_proto" in
17721 ''|0) d_setnetent_r=undef
17722 setnetent_r_proto=0
17723 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17724 * ) case "$setnetent_r_proto" in
17725 REENTRANT_PROTO*) ;;
17726 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17728 echo "Prototype: $try" ;;
17731 *) case "$usethreads" in
17732 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17734 d_setnetent_r=undef
17735 setnetent_r_proto=0
17739 *) setnetent_r_proto=0
17743 : see if setprotoent exists
17744 set setprotoent d_setpent
17747 : see if setpgid exists
17748 set setpgid d_setpgid
17751 : see if setpgrp2 exists
17752 set setpgrp2 d_setpgrp2
17755 : see if setpriority exists
17756 set setpriority d_setprior
17759 : see if setproctitle exists
17760 set setproctitle d_setproctitle
17763 : see if setprotoent_r exists
17764 set setprotoent_r d_setprotoent_r
17766 case "$d_setprotoent_r" in
17768 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17769 case "$d_setprotoent_r_proto:$usethreads" in
17770 ":define") d_setprotoent_r_proto=define
17771 set d_setprotoent_r_proto setprotoent_r $hdrs
17775 case "$d_setprotoent_r_proto" in
17777 case "$setprotoent_r_proto" in
17778 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17779 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17781 case "$setprotoent_r_proto" in
17782 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17783 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17785 case "$setprotoent_r_proto" in
17786 ''|0) d_setprotoent_r=undef
17787 setprotoent_r_proto=0
17788 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17789 * ) case "$setprotoent_r_proto" in
17790 REENTRANT_PROTO*) ;;
17791 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17793 echo "Prototype: $try" ;;
17796 *) case "$usethreads" in
17797 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17799 d_setprotoent_r=undef
17800 setprotoent_r_proto=0
17804 *) setprotoent_r_proto=0
17808 : see if setpwent exists
17809 set setpwent d_setpwent
17812 : see if setpwent_r exists
17813 set setpwent_r d_setpwent_r
17815 case "$d_setpwent_r" in
17817 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17818 case "$d_setpwent_r_proto:$usethreads" in
17819 ":define") d_setpwent_r_proto=define
17820 set d_setpwent_r_proto setpwent_r $hdrs
17824 case "$d_setpwent_r_proto" in
17826 case "$setpwent_r_proto" in
17827 ''|0) try='int setpwent_r(FILE**);'
17828 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17830 case "$setpwent_r_proto" in
17831 ''|0) try='void setpwent_r(FILE**);'
17832 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17834 case "$setpwent_r_proto" in
17835 ''|0) d_setpwent_r=undef
17837 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17838 * ) case "$setpwent_r_proto" in
17839 REENTRANT_PROTO*) ;;
17840 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17842 echo "Prototype: $try" ;;
17845 *) case "$usethreads" in
17846 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17853 *) setpwent_r_proto=0
17857 : see if setregid exists
17858 set setregid d_setregid
17860 set setresgid d_setresgid
17863 : see if setreuid exists
17864 set setreuid d_setreuid
17866 set setresuid d_setresuid
17869 : see if setrgid exists
17870 set setrgid d_setrgid
17873 : see if setruid exists
17874 set setruid d_setruid
17877 : see if setservent exists
17878 set setservent d_setsent
17881 : see if setservent_r exists
17882 set setservent_r d_setservent_r
17884 case "$d_setservent_r" in
17886 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17887 case "$d_setservent_r_proto:$usethreads" in
17888 ":define") d_setservent_r_proto=define
17889 set d_setservent_r_proto setservent_r $hdrs
17893 case "$d_setservent_r_proto" in
17895 case "$setservent_r_proto" in
17896 ''|0) try='int setservent_r(int, struct servent_data*);'
17897 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17899 case "$setservent_r_proto" in
17900 ''|0) try='void setservent_r(int, struct servent_data*);'
17901 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17903 case "$setservent_r_proto" in
17904 ''|0) d_setservent_r=undef
17905 setservent_r_proto=0
17906 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17907 * ) case "$setservent_r_proto" in
17908 REENTRANT_PROTO*) ;;
17909 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17911 echo "Prototype: $try" ;;
17914 *) case "$usethreads" in
17915 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17917 d_setservent_r=undef
17918 setservent_r_proto=0
17922 *) setservent_r_proto=0
17926 : see if setsid exists
17927 set setsid d_setsid
17930 : see if setvbuf exists
17931 set setvbuf d_setvbuf
17934 : see if shmctl exists
17935 set shmctl d_shmctl
17938 : see if shmget exists
17939 set shmget d_shmget
17942 : see if shmat exists
17945 : see what shmat returns
17948 $cat >shmat.c <<'END'
17949 #include <sys/shm.h>
17952 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17957 echo "and it returns ($shmattype)." >&4
17958 : see if a prototype for shmat is available
17959 xxx=`./findhdr sys/shm.h`
17960 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17961 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17972 set d_shmatprototype
17975 : see if shmdt exists
17979 : see how much of the 'shm*(2)' library is present.
17982 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17983 *"$undef"*) h_shm=false;;
17987 case "`ipcs 2>&1`" in
17988 "SVID shared memory"*"not configured"*)
17989 echo "Your $osname does not have the shm*(2) configured." >&4
17992 set shmctl d_shmctl
17994 set shmget d_shmget
18004 : we could also check for sys/ipc.h ...
18005 if $h_shm && $test `./findhdr sys/shm.h`; then
18006 echo "You have the full shm*(2) library." >&4
18009 echo "You don't have the full shm*(2) library." >&4
18015 : see if we have sigaction
18017 if set sigaction val -f d_sigaction; eval $csym; $val; then
18018 echo 'sigaction() found.' >&4
18021 #include <sys/types.h>
18022 #include <signal.h>
18023 #$i_stdlib I_STDLIB
18025 #include <stdlib.h>
18029 struct sigaction act, oact;
18031 oact.sa_handler = 0;
18032 /* so that act and oact are used */
18033 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18037 if eval $compile_ok; then
18040 echo "But you don't seem to have a usable struct sigaction." >&4
18044 echo 'sigaction NOT found.' >&4
18047 set d_sigaction; eval $setvar
18050 : see if this is a sunmath.h system
18051 set sunmath.h i_sunmath
18054 : see if signbit exists
18055 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18058 #$i_sunmath I_SUNMATH
18062 #ifdef I_SUNMATH /* Solaris special math library */
18063 # include <sunmath.h>
18066 int main(int argc, char **argv)
18070 if ((signbit(x) == 0) && (signbit(y) != 0))
18078 if eval $compile; then
18079 if $run ./try; then
18083 $echo "Signbit seems to be available, but doesn't work as I expected."
18084 $echo "I won't use it." >&4
18095 : see if sigprocmask exists
18096 set sigprocmask d_sigprocmask
18099 : see if sigsetjmp exists
18101 case "$d_sigsetjmp" in
18104 #include <setjmp.h>
18105 #$i_stdlib I_STDLIB
18107 #include <stdlib.h>
18113 if (sigsetjmp(env,1))
18116 siglongjmp(env, 1);
18121 if eval $compile; then
18122 if $run ./try >/dev/null 2>&1; then
18123 echo "POSIX sigsetjmp found." >&4
18127 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18133 echo "sigsetjmp not found." >&4
18137 *) val="$d_sigsetjmp"
18138 case "$d_sigsetjmp" in
18139 $define) echo "POSIX sigsetjmp found." >&4;;
18140 $undef) echo "sigsetjmp not found." >&4;;
18148 : see if snprintf exists
18149 set snprintf d_snprintf
18152 : see if vsnprintf exists
18153 set vsnprintf d_vsnprintf
18156 case "$d_snprintf-$d_vsnprintf" in
18159 Checking whether your snprintf() and vsnprintf() work okay...
18161 $cat >try.c <<'EOCP'
18162 /* v?snprintf testing logic courtesy of Russ Allbery.
18163 * According to C99:
18164 * - if the buffer is too short it still must be \0-terminated
18165 * - if the buffer is too short the potentially required length
18166 * must be returned and not -1
18167 * - if the buffer is NULL the potentially required length
18168 * must be returned and not -1 or core dump
18171 #include <stdarg.h>
18175 int test (char *format, ...)
18180 va_start (args, format);
18181 count = vsnprintf (buf, sizeof buf, format, args);
18188 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18189 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18193 if eval $compile; then
18196 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18198 Your snprintf() and snprintf() don't seem to be working okay.
18200 d_snprintf="$undef"
18201 d_vsnprintf="$undef"
18205 echo "(I can't seem to compile the test program--assuming they don't)"
18206 d_snprintf="$undef"
18207 d_vsnprintf="$undef"
18213 : see if sockatmark exists
18214 set sockatmark d_sockatmark
18217 : see if prototype for sockatmark is available
18219 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18222 : see if socks5_init exists
18223 set socks5_init d_socks5_init
18226 : see if sprintf returns the length of the string in the buffer as per ANSI
18227 $echo "Checking whether sprintf returns the length of the string..." >&4
18230 #$i_stdlib I_STDLIB
18232 #include <stdlib.h>
18234 #$i_string I_STRING
18236 # include <string.h>
18238 # include <strings.h>
18247 int check (size_t expect, int test) {
18248 size_t got = strlen(buffer);
18252 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18257 int main(int argc, char **argv) {
18260 check(sprintf(buffer, ""), ++test);
18261 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18262 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18269 if eval $compile; then
18273 sprintf returns the length of the string (as ANSI says it should)
18275 d_sprintf_returns_strlen="$define"
18278 sprintf does not return the length of the string (how old is this system?)
18280 d_sprintf_returns_strlen="$undef"
18284 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18285 d_sprintf_returns_strlen="$undef"
18289 : see if srand48_r exists
18290 set srand48_r d_srand48_r
18292 case "$d_srand48_r" in
18294 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18295 case "$d_srand48_r_proto:$usethreads" in
18296 ":define") d_srand48_r_proto=define
18297 set d_srand48_r_proto srand48_r $hdrs
18301 case "$d_srand48_r_proto" in
18303 case "$srand48_r_proto" in
18304 ''|0) try='int srand48_r(long, struct drand48_data*);'
18305 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18307 case "$srand48_r_proto" in
18308 ''|0) d_srand48_r=undef
18310 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18311 * ) case "$srand48_r_proto" in
18312 REENTRANT_PROTO*) ;;
18313 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18315 echo "Prototype: $try" ;;
18318 *) case "$usethreads" in
18319 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18326 *) srand48_r_proto=0
18330 : see if srandom_r exists
18331 set srandom_r d_srandom_r
18333 case "$d_srandom_r" in
18335 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18336 case "$d_srandom_r_proto:$usethreads" in
18337 ":define") d_srandom_r_proto=define
18338 set d_srandom_r_proto srandom_r $hdrs
18342 case "$d_srandom_r_proto" in
18344 case "$srandom_r_proto" in
18345 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18346 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18348 case "$srandom_r_proto" in
18349 ''|0) d_srandom_r=undef
18351 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18352 * ) case "$srandom_r_proto" in
18353 REENTRANT_PROTO*) ;;
18354 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18356 echo "Prototype: $try" ;;
18359 *) case "$usethreads" in
18360 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18367 *) srandom_r_proto=0
18371 : see if prototype for setresgid is available
18373 set d_sresgproto setresgid $i_unistd unistd.h
18376 : see if prototype for setresuid is available
18378 set d_sresuproto setresuid $i_unistd unistd.h
18381 : see if sys/stat.h is available
18382 set sys/stat.h i_sysstat
18385 : see if stat knows about block sizes
18387 echo "Checking to see if your struct stat has st_blocks field..." >&4
18388 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18391 : see if this is a sys/vfs.h system
18392 set sys/vfs.h i_sysvfs
18395 : see if this is a sys/statfs.h system
18396 set sys/statfs.h i_sysstatfs
18399 : Check for statfs_s
18401 echo "Checking to see if your system supports struct statfs..." >&4
18402 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
18404 case "$d_statfs_s" in
18405 "$define") echo "Yes, it does." ;;
18406 *) echo "No, it doesn't." ;;
18410 : see if struct statfs knows about f_flags
18411 case "$d_statfs_s" in
18414 echo "Checking to see if your struct statfs has f_flags field..." >&4
18415 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
18419 set d_statfs_f_flags
18423 case "$d_statfs_f_flags" in
18424 "$define") echo "Yes, it does." ;;
18425 *) echo "No, it doesn't." ;;
18428 : see what flavor, if any, of static inline is supported
18430 echo "Checking to see if your system supports static inline..."
18431 $cat > try.c <<'EOCP'
18432 #include <stdlib.h>
18433 extern int f_via_a(int x);
18434 extern int f_via_b(int x);
18435 int main(int argc, char **argv)
18444 return EXIT_SUCCESS;
18447 return EXIT_FAILURE;
18451 $cat > a.c <<'EOCP'
18452 static INLINE int f(int x) {
18463 $cat > b.c <<'EOCP'
18464 extern int f(int x);
18472 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18473 case "$perl_static_inline" in
18474 '') # Check the various possibilities, and break out on success.
18475 # For gcc, prefer __inline__, which will still permit
18476 # cflags.SH to add in -ansi.
18477 case "$gccversion" in
18478 '') xxx="inline __inline__ __inline _inline";;
18479 *) xxx="__inline__ inline __inline _inline";;
18481 for inline in $xxx; do
18482 set try -DINLINE=$inline a.c
18483 if eval $compile && $run ./try; then
18484 # Now make sure there is no external linkage of static
18486 set try -DINLINE=$inline -DUSE_B a.c b.c
18487 if eval $compile && $run ./try; then
18488 $echo "Your compiler supports static $inline, " >&4
18489 $echo "but it also creates an external definition," >&4
18490 $echo "so I won't use it." >&4
18493 $echo "Your compiler supports static $inline." >&4
18495 perl_static_inline="static $inline";
18499 $echo "Your compiler does NOT support static $inline." >&4
18504 *inline*) # Some variant of inline exists.
18505 echo "Keeping your $hint value of $perl_static_inline."
18508 static) # No inline capabilities
18509 echo "Keeping your $hint value of $perl_static_inline."
18512 *) # Unrecognized previous value -- blindly trust the supplied
18513 # value and hope it makes sense. Use old value for
18514 # d_static_inline, if there is one.
18515 echo "Keeping your $hint value of $perl_static_inline."
18516 case "$d_static_inline" in
18518 *) val=$d_static_inline ;;
18522 # Fallback to plain 'static' if nothing worked.
18523 case "$perl_static_inline" in
18525 perl_static_inline="static"
18529 set d_static_inline
18531 $rm -f a.[co] b.[co]
18534 : Check stream access
18536 Checking how to access stdio streams by file descriptor number...
18538 case "$stdio_stream_array" in
18539 '') $cat >try.c <<EOCP
18542 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18546 for s in _iob __iob __sF
18548 set try -DSTDIO_STREAM_ARRAY=$s
18549 if eval $compile; then
18550 case "`$run ./try`" in
18551 yes) stdio_stream_array=$s; break ;;
18557 case "$stdio_stream_array" in
18559 I can't figure out how to access stdio streams by file descriptor number.
18561 d_stdio_stream_array="$undef"
18564 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18566 d_stdio_stream_array="$define"
18570 : see if strcoll exists
18571 set strcoll d_strcoll
18574 : check for structure copying
18576 echo "Checking to see if your C compiler can copy structs..." >&4
18577 $cat >try.c <<'EOCP'
18587 if $cc -c try.c >/dev/null 2>&1 ; then
18589 echo "Yup, it can."
18592 echo "Nope, it can't."
18598 : see if strerror and/or sys_errlist[] exist
18600 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18601 if set strerror val -f d_strerror; eval $csym; $val; then
18602 echo 'strerror() found.' >&4
18603 d_strerror="$define"
18604 d_strerrm='strerror(e)'
18605 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18606 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18607 d_syserrlst="$define"
18609 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18610 d_syserrlst="$undef"
18612 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18613 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18614 echo 'strerror() found in string header.' >&4
18615 d_strerror="$define"
18616 d_strerrm='strerror(e)'
18617 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18618 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18619 d_syserrlst="$define"
18621 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18622 d_syserrlst="$undef"
18624 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18625 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18626 d_strerror="$undef"
18627 d_syserrlst="$define"
18628 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18630 echo 'strerror() and sys_errlist[] NOT found.' >&4
18631 d_strerror="$undef"
18632 d_syserrlst="$undef"
18633 d_strerrm='"unknown"'
18637 : see if strerror_r exists
18638 set strerror_r d_strerror_r
18640 case "$d_strerror_r" in
18642 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18643 case "$d_strerror_r_proto:$usethreads" in
18644 ":define") d_strerror_r_proto=define
18645 set d_strerror_r_proto strerror_r $hdrs
18649 case "$d_strerror_r_proto" in
18651 case "$strerror_r_proto" in
18652 ''|0) try='int strerror_r(int, char*, size_t);'
18653 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18655 case "$strerror_r_proto" in
18656 ''|0) try='int strerror_r(int, char*, int);'
18657 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18659 case "$strerror_r_proto" in
18660 ''|0) try='char* strerror_r(int, char*, size_t);'
18661 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18663 case "$strerror_r_proto" in
18664 ''|0) d_strerror_r=undef
18666 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18667 * ) case "$strerror_r_proto" in
18668 REENTRANT_PROTO*) ;;
18669 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18671 echo "Prototype: $try" ;;
18674 *) case "$usethreads" in
18675 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18682 *) strerror_r_proto=0
18686 : see if strftime exists
18687 set strftime d_strftime
18690 : see if strlcat exists
18691 set strlcat d_strlcat
18694 : see if strlcpy exists
18695 set strlcpy d_strlcpy
18698 : see if strtod exists
18699 set strtod d_strtod
18702 : see if strtol exists
18703 set strtol d_strtol
18706 : see if strtold exists
18707 set strtold d_strtold
18710 : see if strtoll exists
18711 set strtoll d_strtoll
18714 case "$d_longlong-$d_strtoll" in
18717 Checking whether your strtoll() works okay...
18719 $cat >try.c <<'EOCP'
18722 #define strtoll __strtoll
18725 #define strtoll _strtoll
18728 extern long long int strtoll(char *s, char **, int);
18729 static int bad = 0;
18730 int check(char *s, long long ell, int een) {
18733 gll = strtoll(s, 0, 10);
18734 if (!((gll == ell) && (errno == een)))
18738 check(" 1", 1LL, 0);
18739 check(" 0", 0LL, 0);
18740 check("-1", -1LL, 0);
18741 check("-9223372036854775808", -9223372036854775808LL, 0);
18742 check("-9223372036854775808", -9223372036854775808LL, 0);
18743 check(" 9223372036854775807", 9223372036854775807LL, 0);
18744 check("-9223372036854775808", -9223372036854775808LL, 0);
18745 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18746 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18752 if eval $compile; then
18755 ok) echo "Your strtoll() seems to be working okay." ;;
18757 Your strtoll() doesn't seem to be working okay.
18763 echo "(I can't seem to compile the test program--assuming it doesn't)"
18769 : see if strtoq exists
18770 set strtoq d_strtoq
18773 : see if strtoul exists
18774 set strtoul d_strtoul
18777 case "$d_strtoul" in
18780 Checking whether your strtoul() works okay...
18782 $cat >try.c <<'EOCP'
18785 extern unsigned long int strtoul(char *s, char **, int);
18786 static int bad = 0;
18787 void check(char *s, unsigned long eul, int een) {
18790 gul = strtoul(s, 0, 10);
18791 if (!((gul == eul) && (errno == een)))
18795 check(" 1", 1L, 0);
18796 check(" 0", 0L, 0);
18798 case "$longsize" in
18800 $cat >>try.c <<'EOCP'
18801 check("18446744073709551615", 18446744073709551615UL, 0);
18802 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18803 #if 0 /* strtoul() for /^-/ strings is undefined. */
18804 check("-1", 18446744073709551615UL, 0);
18805 check("-18446744073709551614", 2, 0);
18806 check("-18446744073709551615", 1, 0);
18807 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18808 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18813 $cat >>try.c <<'EOCP'
18814 check("4294967295", 4294967295UL, 0);
18815 check("4294967296", 4294967295UL, ERANGE);
18816 #if 0 /* strtoul() for /^-/ strings is undefined. */
18817 check("-1", 4294967295UL, 0);
18818 check("-4294967294", 2, 0);
18819 check("-4294967295", 1, 0);
18820 check("-4294967296", 4294967295UL, ERANGE);
18821 check("-4294967297", 4294967295UL, ERANGE);
18826 : Should we write these tests to be more portable by sprintf-ing
18827 : ~0 and then manipulating that char string as input for strtol?
18830 $cat >>try.c <<'EOCP'
18837 if eval $compile; then
18838 case "`$run ./try`" in
18839 ok) echo "Your strtoul() seems to be working okay." ;;
18841 Your strtoul() doesn't seem to be working okay.
18847 echo "(I can't seem to compile the test program--assuming it doesn't)"
18853 : see if strtoull exists
18854 set strtoull d_strtoull
18857 case "$d_longlong-$d_strtoull" in
18860 Checking whether your strtoull() works okay...
18862 $cat >try.c <<'EOCP'
18865 #define strtoull __strtoull
18868 extern unsigned long long int strtoull(char *s, char **, int);
18869 static int bad = 0;
18870 int check(char *s, long long eull, int een) {
18873 gull = strtoull(s, 0, 10);
18874 if (!((gull == eull) && (errno == een)))
18878 check(" 1", 1LL, 0);
18879 check(" 0", 0LL, 0);
18880 check("18446744073709551615", 18446744073709551615ULL, 0);
18881 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18882 #if 0 /* strtoull() for /^-/ strings is undefined. */
18883 check("-1", 18446744073709551615ULL, 0);
18884 check("-18446744073709551614", 2LL, 0);
18885 check("-18446744073709551615", 1LL, 0);
18886 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18887 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18894 if eval $compile; then
18895 case "`$run ./try`" in
18896 ok) echo "Your strtoull() seems to be working okay." ;;
18898 Your strtoull() doesn't seem to be working okay.
18900 d_strtoull="$undef"
18904 echo "(I can't seem to compile the test program--assuming it doesn't)"
18905 d_strtoull="$undef"
18910 : see if strtouq exists
18911 set strtouq d_strtouq
18914 case "$d_strtouq" in
18917 Checking whether your strtouq() works okay...
18919 $cat >try.c <<'EOCP'
18922 extern unsigned long long int strtouq(char *s, char **, int);
18923 static int bad = 0;
18924 void check(char *s, unsigned long long eull, int een) {
18925 unsigned long long gull;
18927 gull = strtouq(s, 0, 10);
18928 if (!((gull == eull) && (errno == een)))
18932 check(" 1", 1LL, 0);
18933 check(" 0", 0LL, 0);
18934 check("18446744073709551615", 18446744073709551615ULL, 0);
18935 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18936 #if 0 /* strtouq() for /^-/ strings is undefined. */
18937 check("-1", 18446744073709551615ULL, 0);
18938 check("-18446744073709551614", 2LL, 0);
18939 check("-18446744073709551615", 1LL, 0);
18940 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18941 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18949 if eval $compile; then
18950 case "`$run ./try`" in
18951 ok) echo "Your strtouq() seems to be working okay." ;;
18953 Your strtouq() doesn't seem to be working okay.
18959 echo "(I can't seem to compile the test program--assuming it doesn't)"
18965 : see if strxfrm exists
18966 set strxfrm d_strxfrm
18969 : see if symlink exists
18970 set symlink d_symlink
18973 : see if syscall exists
18974 set syscall d_syscall
18977 : see if prototype for syscall is available
18979 set d_syscallproto syscall $i_unistd unistd.h
18982 : see if sysconf exists
18983 set sysconf d_sysconf
18986 : see if system exists
18987 set system d_system
18990 : see if tcgetpgrp exists
18991 set tcgetpgrp d_tcgetpgrp
18994 : see if tcsetpgrp exists
18995 set tcsetpgrp d_tcsetpgrp
18998 : see if prototype for telldir is available
19000 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19003 : see if time exists
19005 if test "X$d_time" = X -o X"$timetype" = X; then
19006 if set time val -f d_time; eval $csym; $val; then
19007 echo 'time() found.' >&4
19009 rp="What is the type returned by time() on this system?"
19010 set time_t timetype long stdio.h sys/types.h
19013 echo 'time() not found, hope that will do.' >&4
19021 : see if timegm exists
19022 set timegm d_timegm
19025 : see if this is a sys/times.h system
19026 set sys/times.h i_systimes
19029 : see if times exists
19031 if set times val -f d_times; eval $csym; $val; then
19032 echo 'times() found.' >&4
19035 case "$i_systimes" in
19036 "$define") inc='sys/times.h';;
19038 rp="What is the type returned by times() on this system?"
19039 set clock_t clocktype long stdio.h sys/types.h $inc
19042 echo 'times() NOT found, hope that will do.' >&4
19047 : see if tmpnam_r exists
19048 set tmpnam_r d_tmpnam_r
19050 case "$d_tmpnam_r" in
19052 hdrs="$i_systypes sys/types.h define stdio.h "
19053 case "$d_tmpnam_r_proto:$usethreads" in
19054 ":define") d_tmpnam_r_proto=define
19055 set d_tmpnam_r_proto tmpnam_r $hdrs
19059 case "$d_tmpnam_r_proto" in
19061 case "$tmpnam_r_proto" in
19062 ''|0) try='char* tmpnam_r(char*);'
19063 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19065 case "$tmpnam_r_proto" in
19066 ''|0) d_tmpnam_r=undef
19068 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19069 * ) case "$tmpnam_r_proto" in
19070 REENTRANT_PROTO*) ;;
19071 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19073 echo "Prototype: $try" ;;
19076 *) case "$usethreads" in
19077 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19084 *) tmpnam_r_proto=0
19088 : see if truncate exists
19089 set truncate d_truncate
19092 : see if ttyname_r exists
19093 set ttyname_r d_ttyname_r
19095 case "$d_ttyname_r" in
19097 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19098 case "$d_ttyname_r_proto:$usethreads" in
19099 ":define") d_ttyname_r_proto=define
19100 set d_ttyname_r_proto ttyname_r $hdrs
19104 case "$d_ttyname_r_proto" in
19106 case "$ttyname_r_proto" in
19107 ''|0) try='int ttyname_r(int, char*, size_t);'
19108 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19110 case "$ttyname_r_proto" in
19111 ''|0) try='int ttyname_r(int, char*, int);'
19112 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19114 case "$ttyname_r_proto" in
19115 ''|0) try='char* ttyname_r(int, char*, int);'
19116 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19118 case "$ttyname_r_proto" in
19119 ''|0) d_ttyname_r=undef
19121 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19122 * ) case "$ttyname_r_proto" in
19123 REENTRANT_PROTO*) ;;
19124 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19126 echo "Prototype: $try" ;;
19129 *) case "$usethreads" in
19130 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19137 *) ttyname_r_proto=0
19141 : see if tzname[] exists
19143 if set tzname val -a d_tzname; eval $csym; $val; then
19145 echo 'tzname[] found.' >&4
19148 echo 'tzname[] NOT found.' >&4
19153 : Check if is a multiplatform env
19155 darwin) multiarch="$define" ;;
19157 case "$multiarch" in
19158 ''|[nN]*) multiarch="$undef" ;;
19161 : check for ordering of bytes in a UV
19163 case "$multiarch" in
19166 You seem to be doing a multiarchitecture build,
19167 skipping the byteorder check.
19173 case "$byteorder" in
19176 In the following, larger digits indicate more significance. A big-endian
19177 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19178 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19179 machines may have weird orders like 3412. A Cray will report 87654321,
19180 an Alpha will report 12345678. If the test program works the default is
19182 I'm now running the test program...
19186 #$i_stdlib I_STDLIB
19188 #include <stdlib.h>
19190 #include <sys/types.h>
19191 typedef $uvtype UV;
19201 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19203 u.l = (UV)0x04030201;
19204 for (i = 0; i < $uvsize; i++)
19205 printf("%c", u.c[i]+'0');
19212 if eval $compile && $run ./try > /dev/null; then
19215 [1-4][1-4][1-4][1-4]|12345678|87654321)
19216 echo "(The test program ran ok.)"
19217 echo "byteorder=$dflt"
19220 ????|????????) echo "(The test program ran ok.)" ;;
19221 *) echo "(The test program didn't run right for some reason.)" ;;
19226 (I can't seem to compile the test program. Guessing big-endian...)
19229 case "$xxx_prompt" in
19231 rp="What is the order of bytes in $uvtype?"
19244 : Checking 32bit alignedness
19247 Checking to see whether you can access character data unalignedly...
19249 case "$d_u32align" in
19250 '') $cat >try.c <<EOCP
19252 #$i_stdlib I_STDLIB
19254 #include <stdlib.h>
19256 #define U32 $u32type
19257 #define BYTEORDER 0x$byteorder
19259 #include <signal.h>
19261 $signal_t bletch(int s) { exit(4); }
19264 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19265 volatile U8 buf[8];
19269 if (sizeof(U32) != 4) {
19270 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19277 signal(SIGBUS, bletch);
19289 for (i = 0; i < 4; i++) {
19290 up = (U32*)(buf + i);
19291 if (! ((*up == 1 << (8*i)) || /* big-endian */
19292 (*up == 1 << (8*(3-i))) /* little-endian */
19296 printf("read failed (%x)\n", *up);
19302 for (i = 0; i < 4; i++) {
19303 up = (U32*)(buf + i);
19305 if (*up != 0xBeef) {
19306 printf("write failed (%x)\n", *up);
19320 if eval $compile_ok; then
19321 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19322 $run ./try 2>&1 >/dev/null
19325 You can access character data pretty unalignedly.
19327 d_u32align="$undef"
19330 It seems that you must access character data in an aligned manner.
19332 d_u32align="$define"
19336 rp='Can you access character data at unaligned addresses?'
19340 [yY]*) d_u32align="$undef" ;;
19341 *) d_u32align="$define" ;;
19348 : see if ualarm exists
19349 set ualarm d_ualarm
19352 : see if umask exists
19356 : see if unordered exists
19357 set unordered d_unordered
19360 : see if unsetenv exists
19361 set unsetenv d_unsetenv
19364 : see if usleep exists
19365 set usleep d_usleep
19368 : see if prototype for usleep is available
19370 set d_usleepproto usleep $i_unistd unistd.h
19373 : see if ustat exists
19377 : see if closedir exists
19378 set closedir d_closedir
19381 case "$d_closedir" in
19384 echo "Checking whether closedir() returns a status..." >&4
19386 #$i_dirent I_DIRENT /**/
19387 #$i_sysdir I_SYS_DIR /**/
19388 #$i_sysndir I_SYS_NDIR /**/
19389 #$i_systypes I_SYS_TYPES /**/
19391 #if defined(I_SYS_TYPES)
19392 #include <sys/types.h>
19394 #if defined(I_DIRENT)
19395 #include <dirent.h>
19398 #include <sys/ndir.h>
19402 #include <ndir.h> /* may be wrong in the future */
19404 #include <sys/dir.h>
19409 int main() { return closedir(opendir(".")); }
19412 if eval $compile_ok; then
19413 if $run ./try > /dev/null 2>&1 ; then
19414 echo "Yes, it does."
19417 echo "No, it doesn't."
19421 echo "(I can't seem to compile the test program--assuming it doesn't)"
19429 set d_void_closedir
19433 : see if there is a wait4
19437 : see if waitpid exists
19438 set waitpid d_waitpid
19443 $cat >try.c <<'EOCP'
19449 return (wcscmp (s, s) ? 1 : 0);
19454 if eval $compile; then
19457 0) echo "A working wcscmp() found." >&4
19459 *) echo "wcscmp() found, but it doesn't work" >&4
19463 echo "wcscmp() NOT found." >&4
19469 : see if wcstombs exists
19470 set wcstombs d_wcstombs
19475 $cat >try.c <<'EOCP'
19480 wchar_t dst[4], *src = L" ";
19482 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19487 if eval $compile; then
19490 0) echo "A working wcsxfrm() found." >&4
19492 *) echo "wcsxfrm() found, but it doesn't work" >&4
19496 echo "wcsxfrm() NOT found." >&4
19502 : see if wctomb exists
19503 set wctomb d_wctomb
19506 : see if writev exists
19507 set writev d_writev
19510 : check for alignment requirements
19512 case "$alignbytes" in
19513 '') echo "Checking alignment constraints..." >&4
19514 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19515 $cat >try.c <<'EOCP'
19516 typedef long double NV;
19519 $cat >try.c <<'EOCP'
19523 $cat >>try.c <<'EOCP'
19531 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19536 if eval $compile_ok; then
19540 echo "(I can't seem to compile the test program...)"
19542 case "$multiarch" in
19544 : The usual safe value is 8, but Darwin with -Duselongdouble
19545 : needs 16. Hence, we will take 8 as a minimum, but allow
19546 : Configure to pick a larger value if needed.
19547 if $test "$dflt" -lt 8; then
19549 echo "Setting alignment to 8 for multiarch support.">&4
19554 *) dflt="$alignbytes"
19557 rp="Doubles must be aligned on a how-many-byte boundary?"
19562 : set the base revision
19565 : length of character in bytes. Is always 1, otherwise it is not C
19566 : This used to be a test using sizeof
19569 : Check for the number of bits in a character
19570 case "$charbits" in
19571 '') echo "Checking how long a character is (in bits)..." >&4
19578 for (c = 1, n = 0; c; c <<= 1, n++) ;
19579 printf ("%d\n", n);
19584 if eval $compile_ok; then
19588 echo "(I can't seem to compile the test program. Guessing...)"
19595 rp="What is the length of a character (in bits)?"
19599 case "$charbits" in
19602 Your system has an unsigned character size of $charbits bits, which
19603 is rather unusual (normally it is 8 bits). Perl likely will not work
19604 correctly on your system, with subtle bugs in various places.
19606 rp='Do you really want to continue?'
19610 [yY]) echo >&4 "Okay, continuing." ;;
19615 : how do we concatenate cpp tokens here?
19617 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19618 $cat >cpp_stuff.c <<'EOCP'
19619 #define RCAT(a,b)a/**/b
19620 #define ACAT(a,b)a ## b
19624 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19625 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19626 echo "Oh! Smells like ANSI's been here." >&4
19627 echo "We can catify or stringify, separately or together!"
19629 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19630 echo "Ah, yes! The good old days!" >&4
19631 echo "However, in the good old days we don't know how to stringify and"
19632 echo "catify at the same time."
19636 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19637 You're going to have to edit the values of CAT[2-5] in config.h...
19639 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19643 : see if this is a db.h system
19649 : Check db version.
19651 echo "Checking Berkeley DB version ..." >&4
19657 #include <sys/types.h>
19659 #$i_stdlib I_STDLIB
19661 #include <stdlib.h>
19664 int main(int argc, char *argv[])
19666 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19667 int Major, Minor, Patch ;
19668 unsigned long Version ;
19669 (void)db_version(&Major, &Minor, &Patch) ;
19671 printf("%d %d %d %d %d %d\n",
19672 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19673 Major, Minor, Patch);
19676 printf("You have Berkeley DB Version 2 or greater.\n");
19678 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19679 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19680 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19681 Major, Minor, Patch) ;
19683 /* check that db.h & libdb are compatible */
19684 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19685 printf("db.h and libdb are incompatible.\n") ;
19689 printf("db.h and libdb are compatible.\n") ;
19691 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19692 + DB_VERSION_PATCH ;
19694 /* needs to be >= 2.3.4 */
19695 if (Version < 2003004) {
19696 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19697 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19703 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19708 printf("You have Berkeley DB Version 1.\n");
19709 exit(0); /* DB version < 2: the coast is clear. */
19711 exit(1); /* <db.h> not Berkeley DB? */
19717 if eval $compile_ok && $run ./try; then
19718 echo 'Looks OK.' >&4
19720 db_version_major=$1
19721 db_version_minor=$2
19722 db_version_patch=$3
19724 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19728 : Remove db from list of libraries to use
19729 echo "Removing unusable -ldb from library list" >&4
19730 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19733 echo "libs = $libs" >&4
19743 : Check the return type needed for hash
19745 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19751 #include <sys/types.h>
19754 #ifndef DB_VERSION_MAJOR
19755 u_int32_t hash_cb (const void* ptr, size_t size)
19761 info.hash = hash_cb;
19765 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19766 if $contains warning try.out >>/dev/null 2>&1 ; then
19769 db_hashtype='u_int32_t'
19772 : XXX Maybe we should just give up here.
19773 db_hashtype=u_int32_t
19775 echo "Help: I can't seem to compile the db test program." >&4
19776 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19779 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19781 *) db_hashtype=u_int32_t
19786 : Check the return type needed for prefix
19788 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19794 #include <sys/types.h>
19797 #ifndef DB_VERSION_MAJOR
19798 size_t prefix_cb (const DBT *key1, const DBT *key2)
19804 info.prefix = prefix_cb;
19808 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19809 if $contains warning try.out >>/dev/null 2>&1 ; then
19810 db_prefixtype='int'
19812 db_prefixtype='size_t'
19815 db_prefixtype='size_t'
19816 : XXX Maybe we should just give up here.
19818 echo "Help: I can't seem to compile the db test program." >&4
19819 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19822 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19824 *) db_prefixtype='size_t'
19828 : How can we generate normalized random numbers ?
19830 echo "Using our internal random number implementation..." >&4
19833 *-Dmy_rand=*|*-Dmy_srand=*)
19834 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19835 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19836 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19837 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19841 randfunc=Perl_drand48
19842 drand01="Perl_drand48()"
19843 seedfunc="Perl_drand48_init"
19847 : Determine if this is an EBCDIC system
19849 echo "Determining whether or not we are on an EBCDIC system..." >&4
19850 $cat >try.c <<'EOM'
19853 if ('M'==0xd4) return 0;
19860 if eval $compile_ok; then
19861 if $run ./try; then
19862 echo "You seem to speak EBCDIC." >&4
19865 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19868 echo "I'm unable to compile the test program." >&4
19869 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19875 : Check how to flush
19878 Checking how to flush all pending stdio output...
19880 # I only know how to find the first 32 possibly open files on SunOS.
19881 # See also hints/sunos_4_1.sh and util.c --AD
19883 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19885 $cat >>try.c <<EOCP
19887 #$i_stdlib I_STDLIB
19889 #include <stdlib.h>
19891 #$i_unistd I_UNISTD
19893 # include <unistd.h>
19895 #$d_sysconf HAS_SYSCONF
19896 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19897 #ifdef HAS_STDIO_STREAM_ARRAY
19898 # define STDIO_STREAM_ARRAY $stdio_stream_array
19903 p = fopen("try.out", "w");
19907 # ifdef TRY_FPRINTF
19911 #ifdef TRY_FFLUSH_NULL
19914 #ifdef TRY_FFLUSH_ALL
19916 long open_max = -1;
19917 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19918 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19920 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19921 open_max = sysconf(_SC_OPEN_MAX);
19924 open_max = FOPEN_MAX;
19927 open_max = OPEN_MAX;
19936 # ifdef HAS_STDIO_STREAM_ARRAY
19937 if (open_max > 0) {
19939 for (i = 0; i < open_max; i++)
19940 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19941 STDIO_STREAM_ARRAY[i]._file < open_max &&
19942 STDIO_STREAM_ARRAY[i]._flag)
19943 fflush(&STDIO_STREAM_ARRAY[i]);
19951 : first we have to find out how _not_ to flush
19953 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19955 set try -DTRY_FPUTC
19956 if eval $compile; then
19957 $run ./try 2>/dev/null
19960 if $test ! -s try.out -a "X$code" = X42; then
19966 set try -DTRY_FPRINTF
19967 if eval $compile; then
19968 $run ./try 2>/dev/null
19971 if $test ! -s try.out -a "X$code" = X42; then
19972 output=-DTRY_FPRINTF
19978 : check for fflush NULL behavior
19979 case "$fflushNULL" in
19980 '') set try -DTRY_FFLUSH_NULL $output
19981 if eval $compile; then
19982 $run ./try 2>/dev/null
19985 if $test -s try.out -a "X$code" = X42; then
19986 fflushNULL="`$cat try.out`"
19988 if $test "X$code" != X42; then
19990 (If this test failed, don't worry, we'll try another method shortly.)
19995 $rm -f core try.core core.try.*
19996 case "$fflushNULL" in
19998 Your fflush(NULL) works okay for output streams.
19999 Let's see if it clobbers input pipes...
20001 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20002 # bug that improperly flushes the input end of pipes. So we avoid the
20003 # autoflush on fork/system/exec support for now. :-(
20004 $cat >tryp.c <<EOCP
20007 main(int argc, char **argv)
20013 while ((i = getc(stdin)) != -1
20014 && (*bp++ = i) != '\n'
20015 && bp < &buf[1024])
20018 fprintf(stdout, "%s", buf);
20026 fflushNULL="$define"
20028 if eval $compile; then
20030 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20031 if $test "X$targethost" != X; then
20034 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20036 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20038 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20040 fflush(NULL) seems to behave okay with input streams.
20042 fflushNULL="$define"
20045 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20047 fflushNULL="$undef"
20050 $rm -f core tryp.c tryp.core core.tryp.*
20053 Your fflush(NULL) isn't working (contrary to ANSI C).
20055 fflushNULL="$undef"
20058 Cannot figure out whether your fflush(NULL) works or not.
20059 I'm assuming it doesn't (contrary to ANSI C).
20061 fflushNULL="$undef"
20065 $define|true|[yY]*)
20066 fflushNULL="$define"
20069 fflushNULL="$undef"
20072 : check explicit looping only if NULL did not work, and if the pipe
20073 : bug does not show up on an explicit flush too
20074 case "$fflushNULL" in
20076 $cat >tryp.c <<EOCP
20079 main(int argc, char **argv)
20085 while ((i = getc(stdin)) != -1
20086 && (*bp++ = i) != '\n'
20087 && bp < &buf[1024])
20090 fprintf(stdout, "%s", buf);
20099 if eval $compile; then
20101 if $test "X$targethost" != X; then
20104 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20106 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20108 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20110 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20112 : now check for fflushall behaviour
20113 case "$fflushall" in
20114 '') set try -DTRY_FFLUSH_ALL $output
20115 if eval $compile; then
20117 (Now testing the other method--but note that this also may fail.)
20119 $run ./try 2>/dev/null
20122 if $test -s try.out -a "X$code" = X42; then
20123 fflushall="`$cat try.out`"
20127 case "$fflushall" in
20129 Whew. Flushing explicitly all the stdio streams works.
20131 fflushall="$define"
20134 Sigh. Flushing explicitly all the stdio streams doesn't work.
20139 Cannot figure out whether flushing stdio streams explicitly works or not.
20140 I'm assuming it doesn't.
20146 "$define"|true|[yY]*)
20147 fflushall="$define"
20155 All is futile. Even fflush(stdin) clobbers input pipes!
20162 $rm -f core tryp.c tryp.core core.tryp.*
20164 *) fflushall="$undef"
20168 case "$fflushNULL$fflushall" in
20171 OK, I give up. I cannot figure out how to flush pending stdio output.
20172 We won't be flushing handles at all before fork/exec/popen.
20178 : Store the full pathname to the ar program for use in the C program
20179 : Respect a hint or command line value for full_ar.
20184 : Store the full pathname to the sed program for use in the C program
20187 : see what type gids are declared as in the kernel
20189 echo "Looking for the type for group ids returned by getgid()."
20190 set gid_t gidtype xxx stdio.h sys/types.h
20194 xxx=`./findhdr sys/user.h`
20195 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20197 unsigned) dflt="$1 $2" ;;
20201 *) dflt="$gidtype";;
20204 gid_t) echo "gid_t found." ;;
20205 *) rp="What is the type for group ids returned by getgid()?"
20211 : Check the size of GID
20214 *_t) zzz="$gidtype" ;;
20217 echo "Checking the size of $zzz..." >&4
20219 #include <sys/types.h>
20221 #$i_stdlib I_STDLIB
20223 #include <stdlib.h>
20226 printf("%d\n", (int)sizeof($gidtype));
20231 if eval $compile_ok; then
20235 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20238 echo "Your $zzz is $gidsize bytes long."
20243 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20247 : Check if GID is signed
20250 *_t) zzz="$gidtype" ;;
20253 echo "Checking the sign of $zzz..." >&4
20255 #include <sys/types.h>
20266 if eval $compile; then
20270 echo "(I can't execute the test program--guessing unsigned.)" >&4
20274 1) echo "Your $zzz is unsigned." ;;
20275 -1) echo "Your $zzz is signed." ;;
20281 echo "(I can't compile the test program--guessing unsigned.)" >&4
20285 : Check 64bit sizes
20288 if $test X"$quadtype" != X; then
20290 echo "Checking how to print 64-bit integers..." >&4
20292 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20293 $cat >try.c <<'EOCP'
20294 #include <sys/types.h>
20297 int q = 12345678901;
20298 printf("%ld\n", q);
20302 if eval $compile; then
20306 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20307 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20308 echo "We will use %d."
20314 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20315 $cat >try.c <<'EOCP'
20316 #include <sys/types.h>
20319 long q = 12345678901;
20320 printf("%ld\n", q);
20324 if eval $compile; then
20328 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20329 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20330 echo "We will use %ld."
20336 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20337 $cat >try.c <<'EOCP'
20338 #include <sys/types.h>
20339 #include <inttypes.h>
20342 int64_t q = 12345678901;
20343 printf("%" PRId64 "\n", q);
20347 if eval $compile; then
20351 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20352 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20353 echo "We will use the C9X style."
20359 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20361 #include <sys/types.h>
20364 $quadtype q = 12345678901;
20365 printf("%Ld\n", q);
20369 if eval $compile; then
20373 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20374 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20375 echo "We will use %Ld."
20381 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20382 $cat >try.c <<'EOCP'
20383 #include <sys/types.h>
20386 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20387 printf("%lld\n", q);
20391 if eval $compile; then
20395 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20396 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20397 echo "We will use the %lld style."
20403 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20405 #include <sys/types.h>
20408 $quadtype q = 12345678901;
20409 printf("%qd\n", q);
20413 if eval $compile; then
20417 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20418 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20419 echo "We will use %qd."
20425 if $test X"$sPRId64" = X; then
20426 echo "Cannot figure out how to print 64-bit integers." >&4
20433 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20434 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20436 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20437 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20441 : Check format strings for internal types
20443 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20445 if $test X"$ivsize" = X8; then
20446 ivdformat="$sPRId64"
20447 uvuformat="$sPRIu64"
20448 uvoformat="$sPRIo64"
20449 uvxformat="$sPRIx64"
20450 uvXUformat="$sPRIXU64"
20452 if $test X"$ivsize" = X"$longsize"; then
20459 if $test X"$ivsize" = X"$intsize"; then
20467 if $test X"$ivsize" = X"$shortsize"; then
20478 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20479 nveformat="$sPRIeldbl"
20480 nvfformat="$sPRIfldbl"
20481 nvgformat="$sPRIgldbl"
20482 nvEUformat="$sPRIEUldbl"
20483 nvFUformat="$sPRIFUldbl"
20484 nvGUformat="$sPRIGUldbl"
20494 case "$ivdformat" in
20495 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20500 : Check format string for GID
20503 $echo "Checking the format string to be used for gids..." >&4
20506 -1) if $test X"$gidsize" = X"$ivsize"; then
20507 gidformat="$ivdformat"
20509 if $test X"$gidsize" = X"$longsize"; then
20512 if $test X"$gidsize" = X"$intsize"; then
20515 if $test X"$gidsize" = X"$shortsize"; then
20522 *) if $test X"$gidsize" = X"$uvsize"; then
20523 gidformat="$uvuformat"
20525 if $test X"$gidsize" = X"$longsize"; then
20528 if $test X"$gidsize" = X"$intsize"; then
20531 if $test X"$gidsize" = X"$shortsize"; then
20540 : see if getgroups exists
20541 set getgroups d_getgrps
20544 : see if setgroups exists
20545 set setgroups d_setgrps
20548 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20550 case "$d_getgrps$d_setgrps" in
20552 case "$groupstype" in
20553 '') dflt="$gidtype" ;;
20554 *) dflt="$groupstype" ;;
20557 What type of pointer is the second argument to getgroups() and setgroups()?
20558 Usually this is the same as group ids, $gidtype, but not always.
20561 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20565 *) groupstype="$gidtype";;
20568 : check whether make sets MAKE
20570 echo "Checking if your $make program sets \$(MAKE)..." >&4
20571 case "$make_set_make" in
20573 $sed 's/^X //' > testmake.mak << 'EOF'
20575 X @echo 'maketemp="$(MAKE)"'
20577 case "`$make -f testmake.mak 2>/dev/null`" in
20578 *maketemp=*) make_set_make='#' ;;
20579 *) make_set_make="MAKE=$make" ;;
20581 $rm -f testmake.mak
20584 case "$make_set_make" in
20585 '#') echo "Yup, it does.";;
20586 *) echo "Nope, it doesn't.";;
20589 : see what type is used for mode_t
20590 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20591 set mode_t modetype int stdio.h sys/types.h
20594 : see if we need va_copy
20596 case "$i_stdarg" in
20599 #include <stdarg.h>
20601 #$i_stdlib I_STDLIB
20603 #include <stdlib.h>
20605 #include <signal.h>
20608 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20610 return vfprintf(f, fmt, *valp);
20614 myvfprintf(FILE *f, const char *fmt, va_list val)
20616 return ivfprintf(f, fmt, &val);
20620 myprintf(char *fmt, ...)
20623 va_start(val, fmt);
20624 return myvfprintf(stdout, fmt, val);
20628 main(int ac, char **av)
20630 signal(SIGSEGV, exit);
20632 myprintf("%s%cs all right, then\n", "that", '\'');
20637 if eval $compile && $run ./try 2>&1 >/dev/null; then
20638 case "`$run ./try`" in
20639 "that's all right, then")
20645 yes) echo "It seems that you don't need va_copy()." >&4
20646 need_va_copy="$undef"
20648 *) echo "It seems that va_copy() or similar will be needed." >&4
20649 need_va_copy="$define"
20654 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20655 need_va_copy="$undef"
20659 : see what type is used for size_t
20660 rp="What is the type used for the length parameter for string functions?"
20661 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20664 : check for type of arguments to gethostbyaddr.
20665 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20666 case "$d_gethbyaddr" in
20670 Checking to see what type of arguments are accepted by gethostbyaddr().
20672 hdrs="$define sys/types.h
20673 $d_socket sys/socket.h
20674 $i_niin netinet/in.h
20676 $i_unistd unistd.h"
20677 : The first arg can 'char *' or 'void *'
20678 : The second arg is some of integral type
20679 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20680 for yyy in size_t long int; do
20681 case "$netdb_host_type" in
20682 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20683 if ./protochk "$try" $hdrs; then
20684 echo "Your system accepts $xxx for the first arg."
20685 echo "...and $yyy for the second arg."
20686 netdb_host_type="$xxx"
20687 netdb_hlen_type="$yyy"
20693 : In case none of those worked, prompt the user.
20694 case "$netdb_host_type" in
20695 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20698 netdb_host_type=$ans
20699 rp='What is the type for the 2nd argument to gethostbyaddr?'
20702 netdb_hlen_type=$ans
20706 *) : no gethostbyaddr, so pick harmless defaults
20707 netdb_host_type='char *'
20708 netdb_hlen_type="$sizetype"
20711 # Remove the "const" if needed. -- but then we'll have a
20713 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20716 : check for type of argument to gethostbyname.
20717 if test "X$netdb_name_type" = X ; then
20718 case "$d_gethbyname" in
20722 Checking to see what type of argument is accepted by gethostbyname().
20724 hdrs="$define sys/types.h
20725 $d_socket sys/socket.h
20726 $i_niin netinet/in.h
20728 $i_unistd unistd.h"
20729 for xxx in "const char *" "char *"; do
20730 case "$netdb_name_type" in
20731 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20732 if ./protochk "$try" $hdrs; then
20733 echo "Your system accepts $xxx."
20734 netdb_name_type="$xxx"
20739 : In case none of those worked, prompt the user.
20740 case "$netdb_name_type" in
20741 '') rp='What is the type for the 1st argument to gethostbyname?'
20744 netdb_name_type=$ans
20748 *) : no gethostbyname, so pick harmless default
20749 netdb_name_type='char *'
20754 : check for type of 1st argument to getnetbyaddr.
20755 if test "X$netdb_net_type" = X ; then
20756 case "$d_getnbyaddr" in
20760 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20762 hdrs="$define sys/types.h
20763 $d_socket sys/socket.h
20764 $i_niin netinet/in.h
20766 $i_unistd unistd.h"
20767 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20768 case "$netdb_net_type" in
20769 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20770 if ./protochk "$try" $hdrs; then
20771 echo "Your system accepts $xxx."
20772 netdb_net_type="$xxx"
20777 : In case none of those worked, prompt the user.
20778 case "$netdb_net_type" in
20779 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20782 netdb_net_type=$ans
20786 *) : no getnetbyaddr, so pick harmless default
20787 netdb_net_type='long'
20791 : locate the preferred pager for this system
20798 [a-zA-Z]:/*) dflt=$pg;;
20802 [a-zA-Z]:/*) dflt=$more;;
20806 [a-zA-Z]:/*) dflt=$less;;
20809 '') dflt=/usr/ucb/more;;
20817 rp='What pager is used on your system?'
20821 : see what type pids are declared as in the kernel
20822 rp="What is the type of process ids on this system?"
20823 set pid_t pidtype int stdio.h sys/types.h
20826 : see if ar generates random libraries by itself
20828 echo "Checking how to generate random libraries on your machine..." >&4
20829 echo 'int bar1() { return bar2(); }' > bar1.c
20830 echo 'int bar2() { return 2; }' > bar2.c
20832 #$i_stdlib I_STDLIB
20834 #include <stdlib.h>
20836 int main() { printf("%d\n", bar1()); exit(0); }
20838 $cc $ccflags -c bar1.c >/dev/null 2>&1
20839 $cc $ccflags -c bar2.c >/dev/null 2>&1
20840 $cc $ccflags -c foo.c >/dev/null 2>&1
20841 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20842 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20843 $run ./foobar >/dev/null 2>&1; then
20844 echo "$ar appears to generate random libraries itself."
20846 if [ "X$ranlib" = "X" ]; then
20849 elif $ar s bar$_a >/dev/null 2>&1 &&
20850 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20851 $run ./foobar >/dev/null 2>&1; then
20852 echo "a table of contents needs to be added with '$ar s'."
20855 elif $ar ts bar$_a >/dev/null 2>&1 &&
20856 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20857 $run ./foobar >/dev/null 2>&1; then
20858 echo "a table of contents needs to be added with '$ar ts'."
20865 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20866 $test -f $ranlib || ranlib=''
20869 if $test -n "$ranlib"; then
20870 echo "your system has '$ranlib'; we'll use that."
20873 echo "your system doesn't seem to support random libraries"
20874 echo "so we'll use lorder and tsort to order the libraries."
20881 : see if this is a values.h system
20882 set values.h i_values
20885 : Check the max offset that gmtime and localtime accept
20886 echo "Checking max offsets that gmtime () accepts"
20889 define) yyy="#include <values.h>" ;;
20893 case "$sGMTIME_min/$sGMTIME_max" in
20896 #include <sys/types.h>
20905 void gm_check (time_t t, int min_year, int max_year)
20908 if ( tmp == NULL ||
20909 /* Check tm_year overflow */
20910 tmp->tm_year < min_year || tmp->tm_year > max_year)
20921 gm_check (MAXLONG, 69, 0x7fffffff);
20923 if (tmp == NULL || tmp->tm_year < 0) {
20924 for (i = 63; i >= 0; i--) {
20925 time_t x = pt | ((time_t)1 << i);
20926 if (x < 0 || x < pt) continue;
20927 gm_check (x, 69, 0x7fffffff);
20930 printf ("sGMTIME_max=%ld\n", pt);
20939 gm_check (MINLONG, -1900, 70);
20942 for (i = 36; i >= 0; i--) {
20943 time_t x = pt - ((time_t)1 << i);
20944 if (x > 0) continue;
20945 gm_check (x, -1900, 70);
20948 printf ("sGMTIME_min=%ld\n", pt);
20952 int main (int argc, char *argv[])
20954 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20961 if eval $compile; then
20964 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20970 echo "Checking max offsets that localtime () accepts"
20972 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20975 #include <sys/types.h>
20984 void local_check (time_t t, int min_year, int max_year)
20986 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20989 tmp = localtime (&t);
20990 if ( tmp == NULL ||
20991 /* Check tm_year overflow */
20992 tmp->tm_year < min_year || tmp->tm_year > max_year)
20996 } /* local_check */
21003 local_check (MAXLONG, 69, 0x7fffffff);
21005 if (tmp == NULL || tmp->tm_year < 0) {
21006 for (i = 63; i >= 0; i--) {
21007 time_t x = pt | ((time_t)1 << i);
21008 if (x < 0 || x < pt) continue;
21009 local_check (x, 69, 0x7fffffff);
21012 printf ("sLOCALTIME_max=%ld\n", pt);
21021 local_check (MINLONG, -1900, 70);
21024 for (i = 36; i >= 0; i--) {
21025 time_t x = pt - ((time_t)1 << i);
21026 if (x > 0) continue;
21027 local_check (x, -1900, 70);
21030 printf ("sLOCALTIME_min=%ld\n", pt);
21034 int main (int argc, char *argv[])
21042 if eval $compile; then
21045 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21051 : check for type of arguments to select.
21052 case "$selecttype" in
21053 '') case "$d_select" in
21057 Checking to see what type of arguments are accepted by select().
21059 hdrs="$define sys/types.h
21060 $i_systime sys/time.h
21061 $i_sysselct sys/select.h
21062 $d_socket sys/socket.h"
21063 : The first arg can be int, unsigned, or size_t
21064 : The last arg may or may not be 'const'
21066 : void pointer has been seen but using that
21067 : breaks the selectminbits test
21068 for xxx in 'fd_set *' 'int *'; do
21069 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21070 for tmo in 'struct timeval *' 'const struct timeval *'; do
21072 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21073 if ./protochk "$try" $hdrs; then
21074 echo "Your system accepts $xxx."
21083 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21084 case "$d_fd_set" in
21085 $define) dflt="fd_set *" ;;
21094 *) : no select, so pick a harmless default
21101 : check for the select 'width'
21102 case "$selectminbits" in
21103 '') safebits=`expr $ptrsize \* 8`
21104 case "$d_select" in
21108 Checking to see on how many bits at a time your select() operates...
21111 #include <sys/types.h>
21113 #$i_systime I_SYS_TIME
21114 #$i_systimek I_SYS_TIME_KERNEL
21119 # ifdef I_SYS_TIME_KERNEL
21122 # include <sys/time.h>
21123 # ifdef I_SYS_TIME_KERNEL
21127 #$i_sysselct I_SYS_SELECT
21128 #ifdef I_SYS_SELECT
21129 #include <sys/select.h>
21131 #$d_socket HAS_SOCKET
21133 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21136 #$i_stdlib I_STDLIB
21138 #include <stdlib.h>
21141 #define S sizeof(*(b))
21143 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21144 #define NBITS (NBYTES * 8)
21146 char *s = (char *)malloc(NBYTES);
21155 fp = fopen("try.c", "r");
21161 b = ($selecttype)s;
21162 for (i = 0; i < NBITS; i++)
21166 select(fd + 1, b, 0, 0, &t);
21167 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21169 printf("%d\n", i + 1);
21174 if eval $compile_ok; then
21175 selectminbits=`$run ./try`
21176 case "$selectminbits" in
21178 Cannot figure out on how many bits at a time your select() operates.
21179 I'll play safe and guess it is $safebits bits.
21181 selectminbits=$safebits
21182 bits="$safebits bits"
21185 *) bits="$selectminbits bits" ;;
21187 echo "Your select() operates on $bits at a time." >&4
21189 rp='What is the minimum number of bits your select() operates on?'
21190 case "$byteorder" in
21191 12345678) dflt=64 ;;
21197 selectminbits="$val"
21201 *) : no select, so pick a harmless default
21202 selectminbits=$safebits
21208 : Trace out the files included by signal.h, then look for SIGxxx names.
21209 if [ "X$fieldn" = X ]; then
21210 : Just make some guesses. We check them later.
21211 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21213 xxx=`echo '#include <signal.h>' |
21214 $cppstdin $cppminus $cppflags 2>/dev/null |
21215 $grep '^[ ]*#.*include' |
21216 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21217 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21220 for xx in $xxx /dev/null ; do
21221 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21223 case "$xxxfiles" in
21224 '') xxxfiles=`./findhdr signal.h` ;;
21227 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21228 print substr($2, 4, 20)
21230 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21231 print substr($3, 4, 20)
21233 : Append some common names just in case the awk scan failed.
21234 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21235 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21236 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21237 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21238 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21240 : generate a few handy files for later
21241 $cat > signal.c <<EOCP
21242 #include <sys/types.h>
21243 #include <signal.h>
21244 #$i_stdlib I_STDLIB
21246 #include <stdlib.h>
21251 /* Strange style to avoid deeply-nested #if/#else/#endif */
21254 # define NSIG (_NSIG)
21260 # define NSIG (SIGMAX+1)
21266 # define NSIG (SIG_MAX+1)
21272 # define NSIG (_SIG_MAX+1)
21278 # define NSIG (MAXSIG+1)
21284 # define NSIG (MAX_SIG+1)
21289 # ifdef SIGARRAYSIZE
21290 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21296 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21300 /* Default to some arbitrary number that's big enough to get most
21301 of the common signals.
21307 printf("NSIG %d\n", NSIG);
21313 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21315 printf "#ifdef SIG"; printf $1; printf "\n"
21316 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21317 printf $1; printf ");\n"
21321 printf "#endif /* JUST_NSIG */\n";
21322 printf "exit(0);\n}\n";
21325 $cat >signal.awk <<'EOP'
21326 BEGIN { ndups = 0 }
21327 $1 ~ /^NSIG$/ { nsig = $2 }
21328 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21329 if ($2 > maxsig) { maxsig = $2 }
21330 if (sig_name[$2]) {
21331 dup_name[ndups] = $1
21332 dup_num[ndups] = $2
21344 printf("NSIG %d\n", nsig);
21345 for (n = 1; n < nsig; n++) {
21347 printf("%s %d\n", sig_name[n], sig_num[n])
21350 printf("NUM%d %d\n", n, n)
21353 for (n = 0; n < ndups; n++) {
21354 printf("%s %d\n", dup_name[n], dup_num[n])
21358 $cat >signal_cmd <<EOS
21360 if $test -s signal.lst; then
21361 echo "Using your existing signal.lst file"
21366 $cat >>signal_cmd <<'EOS'
21369 if eval $compile_ok; then
21370 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21371 $uniq | $awk -f signal.awk >signal.lst
21373 echo "(I can't seem be able to compile the whole test program)" >&4
21374 echo "(I'll try it in little pieces.)" >&4
21375 set signal -DJUST_NSIG
21376 if eval $compile_ok; then
21377 $run ./signal$_exe > signal.nsg
21380 echo "I can't seem to figure out how many signals you have." >&4
21381 echo "Guessing 50." >&4
21382 echo 'NSIG 50' > signal.nsg
21384 : Now look at all the signal names, one at a time.
21385 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21386 $cat > signal.c <<EOCP
21387 #include <sys/types.h>
21388 #include <signal.h>
21391 printf("$xx %d\n", SIG${xx});
21396 if eval $compile; then
21397 echo "SIG${xx} found."
21398 $run ./signal$_exe >> signal.ls1
21400 echo "SIG${xx} NOT found."
21403 if $test -s signal.ls1; then
21404 $cat signal.nsg signal.ls1 |
21405 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21409 if $test -s signal.lst; then
21412 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21413 echo 'kill -l' >signal
21414 set X `csh -f <signal`
21418 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21420 echo $@ | $tr ' ' $trnl | \
21421 $awk '{ printf "%s %d\n", $1, ++s; }
21422 END { printf "NSIG %d\n", ++s }' >signal.lst
21424 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21426 chmod a+x signal_cmd
21427 $eunicefix signal_cmd
21429 : generate list of signal names
21431 case "$sig_name_init" in
21433 *) case "$sig_num_init" in
21434 ''|*,*) doinit=yes ;;
21439 echo "Generating a list of signal names and numbers..." >&4
21441 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21442 sig_name=`$awk 'BEGIN { printf "ZERO " }
21443 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21444 sig_num=`$awk 'BEGIN { printf "0 " }
21445 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21446 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21447 !/^NSIG/ { printf "\"%s\", ", $1 }
21448 END { printf "0\n" }' signal.lst`
21449 sig_num_init=`$awk 'BEGIN { printf "0, " }
21450 !/^NSIG/ { printf "%d, ", $2}
21451 END { printf "0\n"}' signal.lst`
21454 echo "The following $sig_count signals are available:"
21456 echo $sig_name | $awk \
21457 'BEGIN { linelen = 0 }
21459 for (i = 1; i <= NF; i++) {
21460 name = "SIG" $i " "
21461 linelen = linelen + length(name)
21462 if (linelen > 70) {
21464 linelen = length(name)
21470 sig_size=`echo $sig_name | awk '{print NF}'`
21471 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21473 : Check size of size
21475 case "$sizetype" in
21476 *_t) zzz="$sizetype" ;;
21477 *) zzz="filesize" ;;
21479 echo "Checking the size of $zzz..." >&4
21481 #include <sys/types.h>
21483 #$i_stdlib I_STDLIB
21485 #include <stdlib.h>
21488 printf("%d\n", (int)sizeof($sizetype));
21493 if eval $compile_ok; then
21497 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21500 echo "Your $zzz size is $sizesize bytes."
21505 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21509 : check for socklen_t
21511 echo "Checking to see if you have socklen_t..." >&4
21513 #include <sys/types.h>
21514 #$d_socket HAS_SOCKET
21516 #include <sys/socket.h>
21518 int main() { socklen_t x = 16; }
21521 if eval $compile; then
21523 echo "You have socklen_t."
21526 echo "You do not have socklen_t."
21527 case "$sizetype" in
21528 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21535 : see if this is a socks.h system
21536 set socks.h i_socks
21539 : check for type of the size argument to socket calls
21540 case "$d_socket" in
21544 Checking to see what type is the last argument of accept().
21547 case "$d_socklen_t" in
21548 "$define") yyy="$yyy socklen_t"
21550 yyy="$yyy $sizetype int long unsigned"
21551 for xxx in $yyy; do
21552 case "$socksizetype" in
21553 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21554 case "$usesocks" in
21556 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21557 echo "Your system accepts '$xxx *' for the last argument of accept()."
21558 socksizetype="$xxx"
21561 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21562 echo "Your system accepts '$xxx *' for the last argument of accept()."
21563 socksizetype="$xxx"
21570 : In case none of those worked, prompt the user.
21571 case "$socksizetype" in
21572 '') rp='What is the type for socket address structure sizes?'
21579 *) : no sockets, so pick relatively harmless default
21584 : see what type is used for signed size_t
21585 set ssize_t ssizetype int stdio.h sys/types.h
21590 #$i_stdlib I_STDLIB
21592 #include <stdlib.h>
21594 #include <sys/types.h>
21595 #define Size_t $sizetype
21596 #define SSize_t $dflt
21599 if (sizeof(Size_t) == sizeof(SSize_t))
21601 else if (sizeof(Size_t) == sizeof(int))
21610 if eval $compile_ok && $run ./try > /dev/null; then
21611 ssizetype=`$run ./try`
21612 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21615 Help! I can't compile and run the ssize_t test program: please enlighten me!
21616 (This is probably a misconfiguration in your system or libraries, and
21617 you really ought to fix it. Still, I'll try anyway.)
21619 I need a type that is the same size as $sizetype, but is guaranteed to
21620 be signed. Common values are ssize_t, int and long.
21623 rp="What signed type is the same size as $sizetype?"
21629 : Check the size of st_ino
21631 $echo "Checking the size of st_ino..." >&4
21632 $cat > try.c <<EOCP
21633 #include <sys/stat.h>
21635 #$i_stdlib I_STDLIB
21637 #include <stdlib.h>
21641 printf("%d\n", (int)sizeof(st.st_ino));
21646 if eval $compile_ok; then
21650 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21652 *) st_ino_size=$val
21653 $echo "Your st_ino is $st_ino_size bytes long."
21658 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21662 : Check if st_ino is signed
21664 $echo "Checking the sign of st_ino..." >&4
21665 $cat > try.c <<EOCP
21666 #include <sys/stat.h>
21671 if (foo.st_ino < 0)
21678 if eval $compile; then
21682 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21684 *) st_ino_sign=$val
21685 case "$st_ino_sign" in
21686 1) $echo "Your st_ino is unsigned." ;;
21687 -1) $echo "Your st_ino is signed." ;;
21693 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21697 : see what type of char stdio uses.
21699 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21700 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21701 echo "Your stdio uses unsigned chars." >&4
21702 stdchar="unsigned char"
21704 echo "Your stdio uses signed chars." >&4
21709 : see what type uids are declared as in the kernel
21711 echo "Looking for the type for user ids returned by getuid()."
21712 set uid_t uidtype xxx stdio.h sys/types.h
21716 xxx=`./findhdr sys/user.h`
21717 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21719 unsigned) dflt="$1 $2" ;;
21723 *) dflt="$uidtype";;
21726 uid_t) echo "uid_t found." ;;
21727 *) rp="What is the type for user ids returned by getuid()?"
21733 : Check size of UID
21736 *_t) zzz="$uidtype" ;;
21739 echo "Checking the size of $zzz..." >&4
21741 #include <sys/types.h>
21743 #$i_stdlib I_STDLIB
21745 #include <stdlib.h>
21748 printf("%d\n", (int)sizeof($uidtype));
21753 if eval $compile_ok; then
21757 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21760 echo "Your $zzz is $uidsize bytes long."
21765 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21768 : Check if UID is signed
21771 *_t) zzz="$uidtype" ;;
21774 echo "Checking the sign of $zzz..." >&4
21776 #include <sys/types.h>
21787 if eval $compile; then
21791 echo "(I can't execute the test program--guessing unsigned.)" >&4
21795 1) echo "Your $zzz is unsigned." ;;
21796 -1) echo "Your $zzz is signed." ;;
21802 echo "(I can't compile the test program--guessing unsigned.)" >&4
21806 : Check format string for UID
21808 $echo "Checking the format string to be used for uids..." >&4
21811 -1) if $test X"$uidsize" = X"$ivsize"; then
21812 uidformat="$ivdformat"
21814 if $test X"$uidsize" = X"$longsize"; then
21817 if $test X"$uidsize" = X"$intsize"; then
21820 if $test X"$uidsize" = X"$shortsize"; then
21827 *) if $test X"$uidsize" = X"$uvsize"; then
21828 uidformat="$uvuformat"
21830 if $test X"$uidsize" = X"$longsize"; then
21833 if $test X"$uidsize" = X"$intsize"; then
21836 if $test X"$uidsize" = X"$shortsize"; then
21845 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21847 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21848 $cat >try.c <<'EOM'
21849 /* Intentionally a long probe as I'd like to sanity check that the exact
21850 approach is going to work, as thinking it will work, but only having it
21851 part working at runtime is worse than not having it. */
21853 #include <sys/types.h>
21854 #include <sys/sysctl.h>
21855 #include <sys/param.h>
21857 #include <string.h>
21858 #include <stdlib.h>
21859 #include <unistd.h>
21862 main(int argc, char **argv) {
21864 char *argv_leaf = strrchr(argv[0], '/');
21870 mib[1] = KERN_PROC;
21871 mib[2] = KERN_PROC_PATHNAME;
21875 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21879 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21884 if (size < strlen(argv_leaf) + 1) {
21885 fprintf(stderr, "size %lu is too short for a path\n",
21886 (unsigned long) size);
21890 if (size > MAXPATHLEN * MAXPATHLEN) {
21891 fprintf(stderr, "size %lu is too long for a path\n",
21892 (unsigned long) size);
21896 buffer = malloc(size);
21902 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21907 if (strlen(buffer) + 1 != size) {
21908 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21909 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21914 if (*buffer != '/') {
21915 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21919 if (strstr(buffer, "/./")) {
21920 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21924 if (strstr(buffer, "/../")) {
21925 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21929 buffer_leaf = strrchr(buffer, '/');
21930 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21931 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21943 if eval $compile; then
21944 if $run ./try; then
21945 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21948 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21952 echo "I'm unable to compile the test program." >&4
21953 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21957 set usekernprocpathname
21960 : Determine if we can use _NSGetExecutablePath to find executing program
21962 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21963 $cat >try.c <<'EOM'
21964 /* Intentionally a long probe as I'd like to sanity check that the exact
21965 approach is going to work, as thinking it will work, but only having it
21966 part working at runtime is worse than not having it. */
21967 #include <mach-o/dyld.h>
21969 #include <stdlib.h>
21970 #include <sys/param.h>
21971 #include <string.h>
21974 main(int argc, char **argv) {
21976 uint32_t size = sizeof(buf);
21980 char *argv_leaf = strrchr(argv[0], '/');
21984 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21988 _NSGetExecutablePath(buf, &size);
21989 if (size > MAXPATHLEN * MAXPATHLEN) {
21990 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21991 (unsigned int) size);
21995 buffer = malloc(size);
22001 result = _NSGetExecutablePath(buffer, &size);
22003 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22004 result, (unsigned int) size);
22008 tidied = realpath(buffer, NULL);
22010 perror("realpath");
22016 if (*tidied != '/') {
22017 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22021 if (strstr(tidied, "/./")) {
22022 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22026 if (strstr(tidied, "/../")) {
22027 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22031 tidied_leaf = strrchr(tidied, '/');
22032 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22033 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22045 if eval $compile; then
22046 if $run ./try; then
22047 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22050 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22053 echo "I'm unable to compile the test program." >&4
22054 echo "I'll assume no _NSGetExecutablePath here." >&4
22057 set usensgetexecutablepath
22060 : Check if site customization support was requested
22061 case "$usesitecustomize" in
22062 $define|true|[Yy]*)
22063 usesitecustomize="$define"
22066 usesitecustomize="$undef"
22070 : see if prototypes support variable argument declarations
22072 case "$prototype$i_stdarg" in
22074 echo "It appears we'll be able to prototype varargs functions." >&4
22078 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22085 : determine compiler compiler
22094 if $test -f "$byacc$_exe"; then
22096 comp="byacc or $comp"
22098 if $test -f "$bison$_exe"; then
22099 comp="$comp or bison -y"
22101 rp="Which compiler compiler ($comp) shall I use?"
22110 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22116 : see if this is a assert.h system
22117 set assert.h i_assert
22120 : see if this is a bfd.h system
22124 : see if this is an execinfo.h system
22125 set execinfo.h i_execinfo
22128 : see if this is a fp.h system
22132 : see if this is a fp_class.h system
22133 set fp_class.h i_fp_class
22136 : see if gdbm.h is available
22141 : see if gdbm_open exists
22142 set gdbm_open d_gdbm_open
22144 case "$d_gdbm_open" in
22147 echo "We won't be including <gdbm.h>"
22156 : see if this is a ieeefp.h system
22157 case "$i_ieeefp" in
22158 '' ) set ieeefp.h i_ieeefp
22163 : see if this is a libutil.h system
22164 set libutil.h i_libutil
22167 : see if mach cthreads are available
22168 if test "X$usethreads" = "X$define"; then
22169 set mach/cthreads.h i_machcthr
22172 i_machcthr="$undef"
22175 : see if this is a mntent.h system
22176 set mntent.h i_mntent
22179 : see if net/errno.h is available
22181 set net/errno.h val
22184 : Unfortunately, it causes problems on some systems. Arrgh.
22187 cat > try.c <<'EOM'
22190 #include <net/errno.h>
22196 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22197 echo "We'll be including <net/errno.h>." >&4
22199 echo "We won't be including <net/errno.h>." >&4
22208 : see if netinet/tcp.h is available
22209 set netinet/tcp.h i_netinettcp
22212 : see if this is a poll.h system
22216 : see if this is a prot.h system
22220 : Preprocessor symbols
22222 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22223 $cat <<'EOSH' > Cppsym.know
22224 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22225 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22226 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22227 arch_pwr ardent ARM ARM32 atarist att386 att3b
22228 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22229 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22230 byteorder byte_order
22231 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22232 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22233 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22234 ELF encore EPI EXTENSIONS
22235 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22236 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22237 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22238 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22239 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22240 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22241 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22242 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22243 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22245 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22246 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22247 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22249 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22250 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22251 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22252 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22253 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22254 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22255 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22256 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22257 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22258 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22259 ns32000 ns32016 ns32332 ns32k nsc32000
22260 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22261 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22262 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22263 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22265 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22266 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22267 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22268 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22269 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22270 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22271 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22272 SYSV4 SYSV5 sysV68 sysV88
22273 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22274 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22275 tower32_800 tower32_850 tss
22276 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22277 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22278 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22279 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22280 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22281 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22283 vax venix VMESA vms
22284 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22285 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22288 # Maybe put other stuff here too.
22289 ./tr '-' '_' <<EOSH >>Cppsym.know
22292 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22293 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22294 $cat Cppsym.know > Cppsym.c
22295 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22296 $rm -f Cppsym.a Cppsym.b Cppsym.c
22297 cat <<EOSH > Cppsym
22299 if $test \$# -gt 0; then
22300 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22301 if $test -s Cppsym.got; then
22308 $tr " " "$trnl" | ./Cppsym.try
22314 cat <<EOSH > Cppsym.try
22316 cat <<'EOCP' > try.c
22319 #define STRINGIFY(a) "a"
22321 #if cpp_stuff == 42
22322 #define StGiFy(a) #a
22323 #define STRINGIFY(a) StGiFy(a)
22325 #if $cpp_stuff != 1 && $cpp_stuff != 42
22326 # include "Bletch: How does this C preprocessor stringify macros?"
22332 cat <<'EOSH' >> Cppsym.try
22334 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22335 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22336 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22337 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22339 echo 'return 0;}' >> try.c
22341 cat <<EOSH >> Cppsym.try
22343 case "$osname-$gccversion" in
22344 irix-) ccflags="\$ccflags -woff 1178" ;;
22345 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22347 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22349 chmod +x Cppsym.try
22350 $eunicefix Cppsym.try
22351 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22352 : Add in any Linux cpp "predefined macros":
22353 case "$osname::$gccversion" in
22354 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22356 rm -f $tHdrH'.h' $tHdrH
22358 # Filter out macro arguments, such as Linux's __INT8_C(c)
22359 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22360 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22361 if [ -s $tHdrH'_cppsym.real' ]; then
22362 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22365 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22368 : now check the C compiler for additional symbols
22369 postprocess_cc_v=''
22371 aix) postprocess_cc_v="|$tr , ' '" ;;
22378 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22381 -D*) echo "\$i" | $sed 's/^-D//';;
22382 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22387 postprocess_cc_v=''
22390 ./ccsym > ccsym1.raw
22391 if $test -s ccsym1.raw; then
22392 $sort ccsym1.raw | $uniq >ccsym.raw
22394 mv ccsym1.raw ccsym.raw
22397 $awk '/\=/ { print $0; next }
22398 { print $0"=1" }' ccsym.raw >ccsym.list
22399 $comm -13 Cppsym.true ccsym.list >ccsym.own
22400 $comm -12 Cppsym.true ccsym.list >ccsym.com
22401 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22403 if $test -z ccsym.raw; then
22404 echo "Your C compiler doesn't seem to define any symbols!" >&4
22406 echo "However, your C preprocessor defines the following symbols:"
22409 cppsymbols=`$cat Cppsym.true`
22410 cppsymbols=`echo $cppsymbols`
22411 cppccsymbols="$cppsymbols"
22413 if $test -s ccsym.com; then
22414 echo "Your C compiler and pre-processor define these symbols:"
22415 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22418 cppccsymbols=`$cat ccsym.com`
22419 cppccsymbols=`echo $cppccsymbols`
22420 $test "$silent" || sleep 1
22422 if $test -s ccsym.cpp; then
22423 $test "$also" && echo " "
22424 echo "Your C pre-processor ${also}defines the following symbols:"
22425 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22427 cppsymbols=`$cat ccsym.cpp`
22428 cppsymbols=`echo $cppsymbols`
22429 $test "$silent" || sleep 1
22431 if $test -s ccsym.own; then
22432 $test "$also" && echo " "
22433 echo "Your C compiler ${also}defines the following cpp symbols:"
22434 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22435 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22436 ccsymbols=`$cat ccsym.own`
22437 ccsymbols=`echo $ccsymbols`
22438 $test "$silent" || sleep 1
22442 : add -D_FORTIFY_SOURCE if feasible and not already there
22443 case "$gccversion" in
22444 4.*) case "$optimize$ccflags" in
22445 *-O*) case "$ccflags$cppsymbols" in
22446 *_FORTIFY_SOURCE=*) # Don't add it again.
22447 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22449 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22450 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22454 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22458 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
22462 : see if this is a termio system
22466 if $test `./findhdr termios.h`; then
22467 set tcsetattr i_termios
22473 "$define") echo "You have POSIX termios.h... good!" >&4;;
22474 *) if ./Cppsym pyr; then
22475 case "`$run /bin/universe`" in
22476 ucb) if $test `./findhdr sgtty.h`; then
22478 echo "<sgtty.h> found." >&4
22480 echo "System is pyramid with BSD universe."
22481 ./warn "<sgtty.h> not found--you could have problems."
22483 *) if $test `./findhdr termio.h`; then
22485 echo "<termio.h> found." >&4
22487 echo "System is pyramid with USG universe."
22488 ./warn "<termio.h> not found--you could have problems."
22492 if $test `./findhdr termio.h`; then
22493 echo "<termio.h> found." >&4
22495 elif $test `./findhdr sgtty.h`; then
22496 echo "<sgtty.h> found." >&4
22499 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22502 if $test `./findhdr sgtty.h`; then
22503 echo "<sgtty.h> found." >&4
22505 elif $test `./findhdr termio.h`; then
22506 echo "<termio.h> found." >&4
22509 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22513 set i_termio; eval $setvar
22514 val=$val2; set i_sgtty; eval $setvar
22515 val=$val3; set i_termios; eval $setvar
22517 : see if stdbool is available
22518 : we want a real compile instead of Inhdr because some Solaris systems
22519 : have stdbool.h, but it can only be used if the compiler indicates it
22520 : is sufficiently c99-compliant.
22524 #include <stdbool.h>
22529 int main(int argc, char **argv)
22535 if eval $compile; then
22536 echo "<stdbool.h> found." >&4
22539 echo "<stdbool.h> NOT found." >&4
22546 : see if stddef is available
22547 set stddef.h i_stddef
22550 : see if sys/access.h is available
22551 set sys/access.h i_sysaccess
22554 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22555 set sys/filio.h i_sysfilio
22558 if $test `./findhdr sys/ioctl.h`; then
22560 echo '<sys/ioctl.h> found.' >&4
22563 if $test $i_sysfilio = "$define"; then
22564 echo '<sys/ioctl.h> NOT found.' >&4
22566 $test $i_sgtty = "$define" && xxx="sgtty.h"
22567 $test $i_termio = "$define" && xxx="termio.h"
22568 $test $i_termios = "$define" && xxx="termios.h"
22569 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22575 : see if socket ioctl defs are in sys/sockio.h
22577 xxx=`./findhdr sys/sockio.h`
22578 if $test "$xxx"; then
22579 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22581 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22584 echo "No socket ioctls found in <sys/sockio.h>." >&4
22589 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22595 : see if this is a syslog.h system
22596 set syslog.h i_syslog
22599 : see if this is a sys/mode.h system
22600 set sys/mode.h i_sysmode
22603 : see if there is a sys/poll.h file
22604 set sys/poll.h i_syspoll
22607 : see if sys/resource.h has to be included
22608 set sys/resource.h i_sysresrc
22611 : see if sys/security.h is available
22612 set sys/security.h i_syssecrt
22615 : see if this is a sys/statvfs.h system
22616 set sys/statvfs.h i_sysstatvfs
22619 : see if this is a sys/un.h system
22620 set sys/un.h i_sysun
22623 : see if this is a sys/utsname.h system
22624 set sys/utsname.h i_sysutsname
22627 : see if this is a syswait system
22628 set sys/wait.h i_syswait
22631 : see if this is a ustat.h system
22632 set ustat.h i_ustat
22635 : see if this is an utime system
22636 set utime.h i_utime
22639 : see if this is a vfork system
22642 set vfork.h i_vfork
22652 echo "Looking for extensions..." >&4
22653 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22654 : contain old or inaccurate or duplicate values.
22655 nonxs_extensions=''
22657 : We do not use find because it might not be available.
22658 : We do not just use MANIFEST because the user may have dropped
22659 : some additional extensions into the source tree and expect them
22662 : Function to recursively find available extensions, ignoring DynaLoader
22663 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22664 : In 5.10.1 and later, extensions are stored in directories
22665 : like File-Glob instead of the older File/Glob/.
22669 DynaLoader|dynaload) ;;
22671 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22672 case "$this_ext" in
22673 Scalar/List/Utils) this_ext="List/Util" ;;
22674 PathTools) this_ext="Cwd" ;;
22676 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
22677 if $contains " $this_ext " $tdir/$$.tmp; then
22679 echo "Duplicate directories detected for extension $xxx" >&4;
22680 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22681 case "$knowitall" in
22689 echo "Ok. Stopping Configure." >&4;
22690 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22693 echo "Ok. You will need to correct config.sh before running make." >&4;
22695 $ls -1 $xxx > $tdir/$$.tmp;
22696 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
22697 xs_extensions="$xs_extensions $this_ext";
22698 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
22699 xs_extensions="$xs_extensions $this_ext";
22700 elif $test -d $xxx; then
22701 nonxs_extensions="$nonxs_extensions $this_ext";
22703 $rm -f $tdir/$$.tmp;
22711 eval $find_extensions
22715 eval $find_extensions
22719 eval $find_extensions
22720 set X $xs_extensions
22722 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22723 set X $nonxs_extensions
22725 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22727 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22729 : Now see which are supported on this system.
22731 for xxx in $xs_extensions ; do
22735 $define) avail_ext="$avail_ext $xxx" ;;
22738 GDBM_File|gdbm_fil)
22740 $define) avail_ext="$avail_ext $xxx" ;;
22743 I18N/Langinfo|i18n_lan)
22744 case "$i_langinfo$d_nl_langinfo" in
22745 $define$define) avail_ext="$avail_ext $xxx" ;;
22749 : XXX Do we need a useipcsysv variable here
22750 case "${d_msg}${d_sem}${d_shm}" in
22751 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22754 NDBM_File|ndbm_fil)
22757 case "$osname-$use64bitint" in
22760 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22763 *) avail_ext="$avail_ext $xxx" ;;
22768 ODBM_File|odbm_fil)
22769 case "${i_dbm}${i_rpcsvcdbm}" in
22771 case "$d_cplusplus" in
22772 define) ;; # delete as a function name will not work
22773 *) case "$osname-$use64bitint" in
22776 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22779 *) avail_ext="$avail_ext $xxx" ;;
22787 case "$useopcode" in
22788 true|define|y) avail_ext="$avail_ext $xxx" ;;
22792 case "$useposix" in
22793 true|define|y) avail_ext="$avail_ext $xxx" ;;
22797 case "$d_socket" in
22798 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22801 Sys/Syslog|sys/syslog)
22802 : XXX syslog requires socket
22803 case "$d_socket" in
22804 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22808 case "$usethreads" in
22810 case "$use5005threads" in
22811 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22815 threads|threads/shared)
22816 # threads and threads::shared are special cases.
22817 # To stop people from asking "Perl 5.8.0 was supposed
22818 # to have this new fancy threads implementation but my
22819 # perl doesn't have it" and from people trying to
22820 # (re)install the threads module using CPAN.pm and
22821 # CPAN.pm then offering to reinstall Perl 5.8.0,
22822 # the threads.pm and threads/shared.pm will always be
22823 # there, croaking informatively ("you need to rebuild
22824 # all of Perl with threads, sorry") when threads haven't
22825 # been compiled in.
22827 avail_ext="$avail_ext $xxx"
22833 cygwin) avail_ext="$avail_ext $xxx" ;;
22836 XS/APItest|xs/apitest)
22837 # This is just for testing. Skip it unless we have dynamic loading.
22840 $define) avail_ext="$avail_ext $xxx" ;;
22843 XS/Typemap|xs/typemap)
22844 # This is just for testing. Skip it unless we have dynamic loading.
22846 $define) avail_ext="$avail_ext $xxx" ;;
22849 *) avail_ext="$avail_ext $xxx"
22858 case "$onlyextensions" in
22860 *) keepextensions=''
22861 echo "You have requested that only certain extensions be included..." >&4
22862 for i in $onlyextensions; do
22863 case " $avail_ext " in
22865 echo "Keeping extension $i."
22866 keepextensions="$keepextensions $i"
22868 *) echo "Ignoring extension $i." ;;
22871 avail_ext="$keepextensions"
22875 case "$noextensions" in
22877 *) keepextensions=''
22878 echo "You have requested that certain extensions be ignored..." >&4
22879 for i in $avail_ext; do
22880 case " $noextensions " in
22881 *" $i "*) echo "Ignoring extension $i." ;;
22882 *) echo "Keeping extension $i.";
22883 keepextensions="$keepextensions $i"
22887 avail_ext="$keepextensions"
22891 : Now see which nonxs extensions are supported on this system.
22892 : For now assume all are.
22894 for xxx in $nonxs_extensions ; do
22898 *) nonxs_ext="$nonxs_ext $xxx"
22910 A number of extensions are supplied with $package. You may choose to
22911 compile these extensions for dynamic loading (the default), compile
22912 them into the $package executable (static loading), or not include
22913 them at all. Answer "none" to include no extensions.
22914 Note that DynaLoader is always built and need not be mentioned here.
22917 case "$dynamic_ext" in
22919 : Exclude those listed in static_ext
22921 for xxx in $avail_ext; do
22922 case " $static_ext " in
22924 *) dflt="$dflt $xxx" ;;
22931 *) dflt="$dynamic_ext"
22932 # Perhaps we are reusing an old out-of-date config.sh.
22935 if test X"$dynamic_ext" != X"$avail_ext"; then
22937 NOTICE: Your previous config.sh list may be incorrect.
22938 The extensions now available to you are
22940 but the default list from your previous config.sh is
22952 rp="What extensions do you wish to load dynamically?"
22955 none) dynamic_ext=' ' ;;
22956 *) dynamic_ext="$ans" ;;
22959 case "$static_ext" in
22961 : Exclude those already listed in dynamic linking
22963 for xxx in $avail_ext; do
22964 case " $dynamic_ext " in
22966 *) dflt="$dflt $xxx" ;;
22973 *) dflt="$static_ext"
22980 rp="What extensions do you wish to load statically?"
22983 none) static_ext=' ' ;;
22984 *) static_ext="$ans" ;;
22989 A number of extensions are supplied with $package. Answer "none"
22990 to include no extensions.
22991 Note that DynaLoader is always built and need not be mentioned here.
22994 case "$static_ext" in
22995 '') dflt="$avail_ext" ;;
22996 *) dflt="$static_ext"
22997 # Perhaps we are reusing an old out-of-date config.sh.
23000 if test X"$static_ext" != X"$avail_ext"; then
23002 NOTICE: Your previous config.sh list may be incorrect.
23003 The extensions now available to you are
23005 but the default list from your previous config.sh is
23014 : Exclude those that are not xs extensions
23018 rp="What extensions do you wish to include?"
23021 none) static_ext=' ' ;;
23022 *) static_ext="$ans" ;;
23027 # Encode is a special case. If we are building Encode as a static
23028 # extension, we need to explicitly list its subextensions as well.
23029 # For other nested extensions, this is handled automatically by
23030 # the appropriate Makefile.PL.
23031 case " $static_ext " in
23032 *" Encode "*) # Add the subextensions of Encode
23034 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23035 static_ext="$static_ext Encode/$xxx"
23036 known_extensions="$known_extensions Encode/$xxx"
23042 set X $dynamic_ext $static_ext $nonxs_ext
23046 # Sanity check: We require an extension suitable for use with
23047 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23048 # should show up as failures in the test suite, but it's helpful to
23049 # catch them now.) The 'extensions' list is normally sorted
23050 # alphabetically, so we need to accept either
23051 # DB_File ... Fcntl ... IO ....
23052 # or something like
23053 # Fcntl ... NDBM_File ... IO ....
23054 case " $extensions" in
23055 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23056 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23057 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23058 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23059 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23063 : Remove libraries needed only for extensions
23064 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23065 : The exception is SunOS 4.x, which needs them.
23066 case "${osname}X${osvers}" in
23070 *) case "$usedl" in
23071 $define|true|[yY]*)
23072 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23076 *) perllibs="$libs"
23082 : Remove build directory name from cppstdin so it can be used from
23083 : either the present location or the final installed location.
23085 : Get out of the UU directory to get correct path name.
23087 case "$cppstdin" in
23089 echo "Stripping down cppstdin path name"
23095 : end of configuration questions
23097 echo "End of configuration questions."
23100 : back to where it started
23101 if test -d ../UU; then
23105 : configuration may be unconditionally patched via a 'config.arch' file
23106 if $test -f config.arch; then
23107 echo "I see a config.arch file, loading it." >&4
23111 : configuration may be patched via a 'config.over' file
23112 if $test -f config.over; then
23115 rp='I see a config.over file. Do you wish to load it?'
23118 n*) echo "OK, I'll ignore it.";;
23120 echo "Configuration override changes have been loaded."
23125 : in case they want portability, strip down executable paths
23126 case "$d_portable" in
23129 echo "Stripping down executable paths..." >&4
23130 for file in $loclist $trylist; do
23132 eval $file=`basename $temp`
23137 : create config.sh file
23139 echo "Creating config.sh..." >&4
23140 $spitshell <<EOT >config.sh
23143 # This file was produced by running the Configure script. It holds all the
23144 # definitions figured out by Configure. Should you modify one of these values,
23145 # do not forget to propagate your changes by running "Configure -der". You may
23146 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23149 # Package name : $package
23150 # Source directory : $src
23151 # Configuration time: $cf_time
23152 # Configured by : $cf_by
23153 # Target system : $myuname
23156 : Add in command line options if available
23157 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23159 $spitshell <<EOT >>config.sh
23168 Revision='$Revision'
23176 alignbytes='$alignbytes'
23177 ansi2knr='$ansi2knr'
23178 aphostname='$aphostname'
23179 api_revision='$api_revision'
23180 api_subversion='$api_subversion'
23181 api_version='$api_version'
23182 api_versionstring='$api_versionstring'
23185 archlibexp='$archlibexp'
23186 archname64='$archname64'
23187 archname='$archname'
23188 archobjs='$archobjs'
23189 asctime_r_proto='$asctime_r_proto'
23198 byteorder='$byteorder'
23200 castflags='$castflags'
23203 cccdlflags='$cccdlflags'
23204 ccdlflags='$ccdlflags'
23206 ccflags_uselargefiles='$ccflags_uselargefiles'
23208 ccsymbols='$ccsymbols'
23209 ccversion='$ccversion'
23211 cf_email='$cf_email'
23213 charbits='$charbits'
23214 charsize='$charsize'
23218 clocktype='$clocktype'
23220 compress='$compress'
23221 contains='$contains'
23225 cpp_stuff='$cpp_stuff'
23226 cppccsymbols='$cppccsymbols'
23227 cppflags='$cppflags'
23229 cppminus='$cppminus'
23231 cppstdin='$cppstdin'
23232 cppsymbols='$cppsymbols'
23233 crypt_r_proto='$crypt_r_proto'
23234 cryptlib='$cryptlib'
23236 ctermid_r_proto='$ctermid_r_proto'
23237 ctime_r_proto='$ctime_r_proto'
23238 d_Gconvert='$d_Gconvert'
23239 d_PRIEUldbl='$d_PRIEUldbl'
23240 d_PRIFUldbl='$d_PRIFUldbl'
23241 d_PRIGUldbl='$d_PRIGUldbl'
23242 d_PRIXU64='$d_PRIXU64'
23243 d_PRId64='$d_PRId64'
23244 d_PRIeldbl='$d_PRIeldbl'
23245 d_PRIfldbl='$d_PRIfldbl'
23246 d_PRIgldbl='$d_PRIgldbl'
23247 d_PRIi64='$d_PRIi64'
23248 d_PRIo64='$d_PRIo64'
23249 d_PRIu64='$d_PRIu64'
23250 d_PRIx64='$d_PRIx64'
23251 d_SCNfldbl='$d_SCNfldbl'
23252 d__fwalk='$d__fwalk'
23253 d_access='$d_access'
23254 d_accessx='$d_accessx'
23258 d_archlib='$d_archlib'
23259 d_asctime64='$d_asctime64'
23260 d_asctime_r='$d_asctime_r'
23263 d_attribute_deprecated='$d_attribute_deprecated'
23264 d_attribute_format='$d_attribute_format'
23265 d_attribute_malloc='$d_attribute_malloc'
23266 d_attribute_nonnull='$d_attribute_nonnull'
23267 d_attribute_noreturn='$d_attribute_noreturn'
23268 d_attribute_pure='$d_attribute_pure'
23269 d_attribute_unused='$d_attribute_unused'
23270 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23271 d_backtrace='$d_backtrace'
23275 d_bsdgetpgrp='$d_bsdgetpgrp'
23276 d_bsdsetpgrp='$d_bsdsetpgrp'
23277 d_builtin_choose_expr='$d_builtin_choose_expr'
23278 d_builtin_expect='$d_builtin_expect'
23280 d_c99_variadic_macros='$d_c99_variadic_macros'
23281 d_casti32='$d_casti32'
23282 d_castneg='$d_castneg'
23283 d_charvspr='$d_charvspr'
23285 d_chroot='$d_chroot'
23286 d_chsize='$d_chsize'
23288 d_clearenv='$d_clearenv'
23289 d_closedir='$d_closedir'
23290 d_cmsghdr_s='$d_cmsghdr_s'
23292 d_copysignl='$d_copysignl'
23293 d_cplusplus='$d_cplusplus'
23295 d_crypt_r='$d_crypt_r'
23297 d_ctermid='$d_ctermid'
23298 d_ctermid_r='$d_ctermid_r'
23299 d_ctime64='$d_ctime64'
23300 d_ctime_r='$d_ctime_r'
23301 d_cuserid='$d_cuserid'
23302 d_dbl_dig='$d_dbl_dig'
23303 d_dbminitproto='$d_dbminitproto'
23304 d_difftime64='$d_difftime64'
23305 d_difftime='$d_difftime'
23306 d_dir_dd_fd='$d_dir_dd_fd'
23308 d_dirnamlen='$d_dirnamlen'
23309 d_dladdr='$d_dladdr'
23310 d_dlerror='$d_dlerror'
23311 d_dlopen='$d_dlopen'
23312 d_dlsymun='$d_dlsymun'
23313 d_dosuid='$d_dosuid'
23314 d_drand48_r='$d_drand48_r'
23315 d_drand48proto='$d_drand48proto'
23317 d_eaccess='$d_eaccess'
23318 d_endgrent='$d_endgrent'
23319 d_endgrent_r='$d_endgrent_r'
23320 d_endhent='$d_endhent'
23321 d_endhostent_r='$d_endhostent_r'
23322 d_endnent='$d_endnent'
23323 d_endnetent_r='$d_endnetent_r'
23324 d_endpent='$d_endpent'
23325 d_endprotoent_r='$d_endprotoent_r'
23326 d_endpwent='$d_endpwent'
23327 d_endpwent_r='$d_endpwent_r'
23328 d_endsent='$d_endsent'
23329 d_endservent_r='$d_endservent_r'
23330 d_eofnblk='$d_eofnblk'
23331 d_eunice='$d_eunice'
23332 d_faststdio='$d_faststdio'
23333 d_fchdir='$d_fchdir'
23334 d_fchmod='$d_fchmod'
23335 d_fchown='$d_fchown'
23337 d_fcntl_can_lock='$d_fcntl_can_lock'
23338 d_fd_macros='$d_fd_macros'
23339 d_fd_set='$d_fd_set'
23340 d_fds_bits='$d_fds_bits'
23341 d_fegetround='$d_fegetround'
23342 d_fgetpos='$d_fgetpos'
23343 d_finite='$d_finite'
23344 d_finitel='$d_finitel'
23345 d_flexfnam='$d_flexfnam'
23347 d_flockproto='$d_flockproto'
23349 d_fp_class='$d_fp_class'
23350 d_fp_classify='$d_fp_classify'
23351 d_fp_classl='$d_fp_classl'
23352 d_fpathconf='$d_fpathconf'
23353 d_fpclass='$d_fpclass'
23354 d_fpclassify='$d_fpclassify'
23355 d_fpclassl='$d_fpclassl'
23356 d_fpgetround='$d_fpgetround'
23357 d_fpos64_t='$d_fpos64_t'
23358 d_frexpl='$d_frexpl'
23359 d_fs_data_s='$d_fs_data_s'
23360 d_fseeko='$d_fseeko'
23361 d_fsetpos='$d_fsetpos'
23362 d_fstatfs='$d_fstatfs'
23363 d_fstatvfs='$d_fstatvfs'
23365 d_ftello='$d_ftello'
23367 d_futimes='$d_futimes'
23368 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23369 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23370 d_getaddrinfo='$d_getaddrinfo'
23371 d_getcwd='$d_getcwd'
23372 d_getespwnam='$d_getespwnam'
23373 d_getfsstat='$d_getfsstat'
23374 d_getgrent='$d_getgrent'
23375 d_getgrent_r='$d_getgrent_r'
23376 d_getgrgid_r='$d_getgrgid_r'
23377 d_getgrnam_r='$d_getgrnam_r'
23378 d_getgrps='$d_getgrps'
23379 d_gethbyaddr='$d_gethbyaddr'
23380 d_gethbyname='$d_gethbyname'
23381 d_gethent='$d_gethent'
23382 d_gethname='$d_gethname'
23383 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23384 d_gethostbyname_r='$d_gethostbyname_r'
23385 d_gethostent_r='$d_gethostent_r'
23386 d_gethostprotos='$d_gethostprotos'
23387 d_getitimer='$d_getitimer'
23388 d_getlogin='$d_getlogin'
23389 d_getlogin_r='$d_getlogin_r'
23390 d_getmnt='$d_getmnt'
23391 d_getmntent='$d_getmntent'
23392 d_getnameinfo='$d_getnameinfo'
23393 d_getnbyaddr='$d_getnbyaddr'
23394 d_getnbyname='$d_getnbyname'
23395 d_getnent='$d_getnent'
23396 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23397 d_getnetbyname_r='$d_getnetbyname_r'
23398 d_getnetent_r='$d_getnetent_r'
23399 d_getnetprotos='$d_getnetprotos'
23400 d_getpagsz='$d_getpagsz'
23401 d_getpbyname='$d_getpbyname'
23402 d_getpbynumber='$d_getpbynumber'
23403 d_getpent='$d_getpent'
23404 d_getpgid='$d_getpgid'
23405 d_getpgrp2='$d_getpgrp2'
23406 d_getpgrp='$d_getpgrp'
23407 d_getppid='$d_getppid'
23408 d_getprior='$d_getprior'
23409 d_getprotobyname_r='$d_getprotobyname_r'
23410 d_getprotobynumber_r='$d_getprotobynumber_r'
23411 d_getprotoent_r='$d_getprotoent_r'
23412 d_getprotoprotos='$d_getprotoprotos'
23413 d_getprpwnam='$d_getprpwnam'
23414 d_getpwent='$d_getpwent'
23415 d_getpwent_r='$d_getpwent_r'
23416 d_getpwnam_r='$d_getpwnam_r'
23417 d_getpwuid_r='$d_getpwuid_r'
23418 d_getsbyname='$d_getsbyname'
23419 d_getsbyport='$d_getsbyport'
23420 d_getsent='$d_getsent'
23421 d_getservbyname_r='$d_getservbyname_r'
23422 d_getservbyport_r='$d_getservbyport_r'
23423 d_getservent_r='$d_getservent_r'
23424 d_getservprotos='$d_getservprotos'
23425 d_getspnam='$d_getspnam'
23426 d_getspnam_r='$d_getspnam_r'
23427 d_gettimeod='$d_gettimeod'
23428 d_gmtime64='$d_gmtime64'
23429 d_gmtime_r='$d_gmtime_r'
23430 d_gnulibc='$d_gnulibc'
23431 d_grpasswd='$d_grpasswd'
23432 d_hasmntopt='$d_hasmntopt'
23434 d_ilogbl='$d_ilogbl'
23435 d_inc_version_list='$d_inc_version_list'
23437 d_inetaton='$d_inetaton'
23438 d_inetntop='$d_inetntop'
23439 d_inetpton='$d_inetpton'
23440 d_int64_t='$d_int64_t'
23441 d_ip_mreq='$d_ip_mreq'
23442 d_ip_mreq_source='$d_ip_mreq_source'
23443 d_ipv6_mreq='$d_ipv6_mreq'
23444 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23445 d_isascii='$d_isascii'
23446 d_isblank='$d_isblank'
23447 d_isfinite='$d_isfinite'
23448 d_isfinitel='$d_isfinitel'
23450 d_isinfl='$d_isinfl'
23452 d_isnanl='$d_isnanl'
23455 d_killpg='$d_killpg'
23456 d_lchown='$d_lchown'
23457 d_ldbl_dig='$d_ldbl_dig'
23458 d_ldexpl='$d_ldexpl'
23459 d_libm_lib_version='$d_libm_lib_version'
23460 d_libname_unique='$d_libname_unique'
23462 d_localtime64='$d_localtime64'
23463 d_localtime_r='$d_localtime_r'
23464 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23465 d_locconv='$d_locconv'
23467 d_longdbl='$d_longdbl'
23468 d_longlong='$d_longlong'
23469 d_lseekproto='$d_lseekproto'
23471 d_madvise='$d_madvise'
23472 d_malloc_good_size='$d_malloc_good_size'
23473 d_malloc_size='$d_malloc_size'
23475 d_mbstowcs='$d_mbstowcs'
23476 d_mbtowc='$d_mbtowc'
23477 d_memchr='$d_memchr'
23478 d_memcmp='$d_memcmp'
23479 d_memcpy='$d_memcpy'
23480 d_memmove='$d_memmove'
23481 d_memset='$d_memset'
23483 d_mkdtemp='$d_mkdtemp'
23484 d_mkfifo='$d_mkfifo'
23485 d_mkstemp='$d_mkstemp'
23486 d_mkstemps='$d_mkstemps'
23487 d_mktime64='$d_mktime64'
23488 d_mktime='$d_mktime'
23491 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23492 d_modflproto='$d_modflproto'
23493 d_mprotect='$d_mprotect'
23495 d_msg_ctrunc='$d_msg_ctrunc'
23496 d_msg_dontroute='$d_msg_dontroute'
23497 d_msg_oob='$d_msg_oob'
23498 d_msg_peek='$d_msg_peek'
23499 d_msg_proxy='$d_msg_proxy'
23500 d_msgctl='$d_msgctl'
23501 d_msgget='$d_msgget'
23502 d_msghdr_s='$d_msghdr_s'
23503 d_msgrcv='$d_msgrcv'
23504 d_msgsnd='$d_msgsnd'
23506 d_munmap='$d_munmap'
23507 d_mymalloc='$d_mymalloc'
23509 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23511 d_nl_langinfo='$d_nl_langinfo'
23512 d_nv_preserves_uv='$d_nv_preserves_uv'
23513 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23514 d_off64_t='$d_off64_t'
23515 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23516 d_oldpthreads='$d_oldpthreads'
23517 d_oldsock='$d_oldsock'
23519 d_pathconf='$d_pathconf'
23521 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23522 d_phostname='$d_phostname'
23525 d_portable='$d_portable'
23527 d_prctl_set_name='$d_prctl_set_name'
23528 d_printf_format_null='$d_printf_format_null'
23529 d_procselfexe='$d_procselfexe'
23530 d_pseudofork='$d_pseudofork'
23531 d_pthread_atfork='$d_pthread_atfork'
23532 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23533 d_pthread_yield='$d_pthread_yield'
23534 d_ptrdiff_t='$d_ptrdiff_t'
23536 d_pwchange='$d_pwchange'
23537 d_pwclass='$d_pwclass'
23538 d_pwcomment='$d_pwcomment'
23539 d_pwexpire='$d_pwexpire'
23540 d_pwgecos='$d_pwgecos'
23541 d_pwpasswd='$d_pwpasswd'
23542 d_pwquota='$d_pwquota'
23545 d_random_r='$d_random_r'
23546 d_readdir64_r='$d_readdir64_r'
23547 d_readdir='$d_readdir'
23548 d_readdir_r='$d_readdir_r'
23549 d_readlink='$d_readlink'
23551 d_recvmsg='$d_recvmsg'
23552 d_rename='$d_rename'
23553 d_rewinddir='$d_rewinddir'
23555 d_safebcpy='$d_safebcpy'
23556 d_safemcpy='$d_safemcpy'
23557 d_sanemcmp='$d_sanemcmp'
23558 d_sbrkproto='$d_sbrkproto'
23559 d_scalbnl='$d_scalbnl'
23560 d_sched_yield='$d_sched_yield'
23561 d_scm_rights='$d_scm_rights'
23562 d_seekdir='$d_seekdir'
23563 d_select='$d_select'
23565 d_semctl='$d_semctl'
23566 d_semctl_semid_ds='$d_semctl_semid_ds'
23567 d_semctl_semun='$d_semctl_semun'
23568 d_semget='$d_semget'
23570 d_sendmsg='$d_sendmsg'
23571 d_setegid='$d_setegid'
23572 d_seteuid='$d_seteuid'
23573 d_setgrent='$d_setgrent'
23574 d_setgrent_r='$d_setgrent_r'
23575 d_setgrps='$d_setgrps'
23576 d_sethent='$d_sethent'
23577 d_sethostent_r='$d_sethostent_r'
23578 d_setitimer='$d_setitimer'
23579 d_setlinebuf='$d_setlinebuf'
23580 d_setlocale='$d_setlocale'
23581 d_setlocale_r='$d_setlocale_r'
23582 d_setnent='$d_setnent'
23583 d_setnetent_r='$d_setnetent_r'
23584 d_setpent='$d_setpent'
23585 d_setpgid='$d_setpgid'
23586 d_setpgrp2='$d_setpgrp2'
23587 d_setpgrp='$d_setpgrp'
23588 d_setprior='$d_setprior'
23589 d_setproctitle='$d_setproctitle'
23590 d_setprotoent_r='$d_setprotoent_r'
23591 d_setpwent='$d_setpwent'
23592 d_setpwent_r='$d_setpwent_r'
23593 d_setregid='$d_setregid'
23594 d_setresgid='$d_setresgid'
23595 d_setresuid='$d_setresuid'
23596 d_setreuid='$d_setreuid'
23597 d_setrgid='$d_setrgid'
23598 d_setruid='$d_setruid'
23599 d_setsent='$d_setsent'
23600 d_setservent_r='$d_setservent_r'
23601 d_setsid='$d_setsid'
23602 d_setvbuf='$d_setvbuf'
23605 d_shmatprototype='$d_shmatprototype'
23606 d_shmctl='$d_shmctl'
23608 d_shmget='$d_shmget'
23609 d_sigaction='$d_sigaction'
23610 d_signbit='$d_signbit'
23611 d_sigprocmask='$d_sigprocmask'
23612 d_sigsetjmp='$d_sigsetjmp'
23613 d_sin6_scope_id='$d_sin6_scope_id'
23614 d_sitearch='$d_sitearch'
23615 d_snprintf='$d_snprintf'
23616 d_sockaddr_in6='$d_sockaddr_in6'
23617 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23618 d_sockatmark='$d_sockatmark'
23619 d_sockatmarkproto='$d_sockatmarkproto'
23620 d_socket='$d_socket'
23621 d_socklen_t='$d_socklen_t'
23622 d_sockpair='$d_sockpair'
23623 d_socks5_init='$d_socks5_init'
23624 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23626 d_srand48_r='$d_srand48_r'
23627 d_srandom_r='$d_srandom_r'
23628 d_sresgproto='$d_sresgproto'
23629 d_sresuproto='$d_sresuproto'
23630 d_statblks='$d_statblks'
23631 d_statfs_f_flags='$d_statfs_f_flags'
23632 d_statfs_s='$d_statfs_s'
23633 d_static_inline='$d_static_inline'
23634 d_statvfs='$d_statvfs'
23635 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23636 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23637 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23638 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23639 d_stdio_stream_array='$d_stdio_stream_array'
23640 d_stdiobase='$d_stdiobase'
23641 d_stdstdio='$d_stdstdio'
23642 d_strchr='$d_strchr'
23643 d_strcoll='$d_strcoll'
23644 d_strctcpy='$d_strctcpy'
23645 d_strerrm='$d_strerrm'
23646 d_strerror='$d_strerror'
23647 d_strerror_r='$d_strerror_r'
23648 d_strftime='$d_strftime'
23649 d_strlcat='$d_strlcat'
23650 d_strlcpy='$d_strlcpy'
23651 d_strtod='$d_strtod'
23652 d_strtol='$d_strtol'
23653 d_strtold='$d_strtold'
23654 d_strtoll='$d_strtoll'
23655 d_strtoq='$d_strtoq'
23656 d_strtoul='$d_strtoul'
23657 d_strtoull='$d_strtoull'
23658 d_strtouq='$d_strtouq'
23659 d_strxfrm='$d_strxfrm'
23660 d_suidsafe='$d_suidsafe'
23661 d_symlink='$d_symlink'
23662 d_syscall='$d_syscall'
23663 d_syscallproto='$d_syscallproto'
23664 d_sysconf='$d_sysconf'
23665 d_sysernlst='$d_sysernlst'
23666 d_syserrlst='$d_syserrlst'
23667 d_system='$d_system'
23668 d_tcgetpgrp='$d_tcgetpgrp'
23669 d_tcsetpgrp='$d_tcsetpgrp'
23670 d_telldir='$d_telldir'
23671 d_telldirproto='$d_telldirproto'
23673 d_timegm='$d_timegm'
23675 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23676 d_tm_tm_zone='$d_tm_tm_zone'
23677 d_tmpnam_r='$d_tmpnam_r'
23678 d_truncate='$d_truncate'
23679 d_ttyname_r='$d_ttyname_r'
23680 d_tzname='$d_tzname'
23681 d_u32align='$d_u32align'
23682 d_ualarm='$d_ualarm'
23685 d_union_semun='$d_union_semun'
23686 d_unordered='$d_unordered'
23687 d_unsetenv='$d_unsetenv'
23688 d_usleep='$d_usleep'
23689 d_usleepproto='$d_usleepproto'
23691 d_vendorarch='$d_vendorarch'
23692 d_vendorbin='$d_vendorbin'
23693 d_vendorlib='$d_vendorlib'
23694 d_vendorscript='$d_vendorscript'
23696 d_void_closedir='$d_void_closedir'
23697 d_voidsig='$d_voidsig'
23698 d_voidtty='$d_voidtty'
23699 d_volatile='$d_volatile'
23700 d_vprintf='$d_vprintf'
23701 d_vsnprintf='$d_vsnprintf'
23703 d_waitpid='$d_waitpid'
23704 d_wcscmp='$d_wcscmp'
23705 d_wcstombs='$d_wcstombs'
23706 d_wcsxfrm='$d_wcsxfrm'
23707 d_wctomb='$d_wctomb'
23708 d_writev='$d_writev'
23711 db_hashtype='$db_hashtype'
23712 db_prefixtype='$db_prefixtype'
23713 db_version_major='$db_version_major'
23714 db_version_minor='$db_version_minor'
23715 db_version_patch='$db_version_patch'
23716 direntrytype='$direntrytype'
23719 doublesize='$doublesize'
23721 drand48_r_proto='$drand48_r_proto'
23723 dynamic_ext='$dynamic_ext'
23729 endgrent_r_proto='$endgrent_r_proto'
23730 endhostent_r_proto='$endhostent_r_proto'
23731 endnetent_r_proto='$endnetent_r_proto'
23732 endprotoent_r_proto='$endprotoent_r_proto'
23733 endpwent_r_proto='$endpwent_r_proto'
23734 endservent_r_proto='$endservent_r_proto'
23735 eunicefix='$eunicefix'
23738 extensions='$extensions'
23739 extern_C='$extern_C'
23741 fflushNULL='$fflushNULL'
23742 fflushall='$fflushall'
23744 firstmakefile='$firstmakefile'
23746 fpossize='$fpossize'
23747 fpostype='$fpostype'
23748 freetype='$freetype'
23751 full_csh='$full_csh'
23752 full_sed='$full_sed'
23753 gccansipedantic='$gccansipedantic'
23754 gccosandvers='$gccosandvers'
23755 gccversion='$gccversion'
23756 getgrent_r_proto='$getgrent_r_proto'
23757 getgrgid_r_proto='$getgrgid_r_proto'
23758 getgrnam_r_proto='$getgrnam_r_proto'
23759 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23760 gethostbyname_r_proto='$gethostbyname_r_proto'
23761 gethostent_r_proto='$gethostent_r_proto'
23762 getlogin_r_proto='$getlogin_r_proto'
23763 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23764 getnetbyname_r_proto='$getnetbyname_r_proto'
23765 getnetent_r_proto='$getnetent_r_proto'
23766 getprotobyname_r_proto='$getprotobyname_r_proto'
23767 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23768 getprotoent_r_proto='$getprotoent_r_proto'
23769 getpwent_r_proto='$getpwent_r_proto'
23770 getpwnam_r_proto='$getpwnam_r_proto'
23771 getpwuid_r_proto='$getpwuid_r_proto'
23772 getservbyname_r_proto='$getservbyname_r_proto'
23773 getservbyport_r_proto='$getservbyport_r_proto'
23774 getservent_r_proto='$getservent_r_proto'
23775 getspnam_r_proto='$getspnam_r_proto'
23776 gidformat='$gidformat'
23782 gmtime_r_proto='$gmtime_r_proto'
23783 gnulibc_version='$gnulibc_version'
23785 groupcat='$groupcat'
23786 groupstype='$groupstype'
23789 h_sysfile='$h_sysfile'
23792 hostgenerate='$hostgenerate'
23793 hostosname='$hostosname'
23794 hostperl='$hostperl'
23795 html1dir='$html1dir'
23796 html1direxp='$html1direxp'
23797 html3dir='$html3dir'
23798 html3direxp='$html3direxp'
23807 i_arpainet='$i_arpainet'
23808 i_assert='$i_assert'
23810 i_bsdioctl='$i_bsdioctl'
23814 i_dirent='$i_dirent'
23816 i_execinfo='$i_execinfo'
23821 i_fp_class='$i_fp_class'
23823 i_gdbm_ndbm='$i_gdbm_ndbm'
23824 i_gdbmndbm='$i_gdbmndbm'
23826 i_ieeefp='$i_ieeefp'
23827 i_inttypes='$i_inttypes'
23828 i_langinfo='$i_langinfo'
23829 i_libutil='$i_libutil'
23830 i_limits='$i_limits'
23831 i_locale='$i_locale'
23832 i_machcthr='$i_machcthr'
23833 i_malloc='$i_malloc'
23834 i_mallocmalloc='$i_mallocmalloc'
23836 i_memory='$i_memory'
23837 i_mntent='$i_mntent'
23840 i_neterrno='$i_neterrno'
23841 i_netinettcp='$i_netinettcp'
23845 i_pthread='$i_pthread'
23847 i_rpcsvcdbm='$i_rpcsvcdbm'
23849 i_shadow='$i_shadow'
23851 i_stdarg='$i_stdarg'
23852 i_stdbool='$i_stdbool'
23853 i_stddef='$i_stddef'
23854 i_stdint='$i_stdint'
23855 i_stdlib='$i_stdlib'
23856 i_string='$i_string'
23857 i_sunmath='$i_sunmath'
23858 i_sysaccess='$i_sysaccess'
23859 i_sysdir='$i_sysdir'
23860 i_sysfile='$i_sysfile'
23861 i_sysfilio='$i_sysfilio'
23863 i_sysioctl='$i_sysioctl'
23864 i_syslog='$i_syslog'
23865 i_sysmman='$i_sysmman'
23866 i_sysmode='$i_sysmode'
23867 i_sysmount='$i_sysmount'
23868 i_sysndir='$i_sysndir'
23869 i_sysparam='$i_sysparam'
23870 i_syspoll='$i_syspoll'
23871 i_sysresrc='$i_sysresrc'
23872 i_syssecrt='$i_syssecrt'
23873 i_sysselct='$i_sysselct'
23874 i_syssockio='$i_syssockio'
23875 i_sysstat='$i_sysstat'
23876 i_sysstatfs='$i_sysstatfs'
23877 i_sysstatvfs='$i_sysstatvfs'
23878 i_systime='$i_systime'
23879 i_systimek='$i_systimek'
23880 i_systimes='$i_systimes'
23881 i_systypes='$i_systypes'
23882 i_sysuio='$i_sysuio'
23884 i_sysutsname='$i_sysutsname'
23885 i_sysvfs='$i_sysvfs'
23886 i_syswait='$i_syswait'
23887 i_termio='$i_termio'
23888 i_termios='$i_termios'
23890 i_unistd='$i_unistd'
23893 i_values='$i_values'
23894 i_varargs='$i_varargs'
23895 i_varhdr='$i_varhdr'
23897 ignore_versioned_solibs='$ignore_versioned_solibs'
23898 inc_version_list='$inc_version_list'
23899 inc_version_list_init='$inc_version_list_init'
23903 initialinstalllocation='$initialinstalllocation'
23904 installarchlib='$installarchlib'
23905 installbin='$installbin'
23906 installhtml1dir='$installhtml1dir'
23907 installhtml3dir='$installhtml3dir'
23908 installman1dir='$installman1dir'
23909 installman3dir='$installman3dir'
23910 installprefix='$installprefix'
23911 installprefixexp='$installprefixexp'
23912 installprivlib='$installprivlib'
23913 installscript='$installscript'
23914 installsitearch='$installsitearch'
23915 installsitebin='$installsitebin'
23916 installsitehtml1dir='$installsitehtml1dir'
23917 installsitehtml3dir='$installsitehtml3dir'
23918 installsitelib='$installsitelib'
23919 installsiteman1dir='$installsiteman1dir'
23920 installsiteman3dir='$installsiteman3dir'
23921 installsitescript='$installsitescript'
23922 installstyle='$installstyle'
23923 installusrbinperl='$installusrbinperl'
23924 installvendorarch='$installvendorarch'
23925 installvendorbin='$installvendorbin'
23926 installvendorhtml1dir='$installvendorhtml1dir'
23927 installvendorhtml3dir='$installvendorhtml3dir'
23928 installvendorlib='$installvendorlib'
23929 installvendorman1dir='$installvendorman1dir'
23930 installvendorman3dir='$installvendorman3dir'
23931 installvendorscript='$installvendorscript'
23933 issymlink='$issymlink'
23934 ivdformat='$ivdformat'
23937 known_extensions='$known_extensions'
23940 ld_can_script='$ld_can_script'
23941 lddlflags='$lddlflags'
23943 ldflags_uselargefiles='$ldflags_uselargefiles'
23944 ldlibpthname='$ldlibpthname'
23951 libsdirs='$libsdirs'
23952 libsfiles='$libsfiles'
23953 libsfound='$libsfound'
23954 libspath='$libspath'
23955 libswanted='$libswanted'
23956 libswanted_uselargefiles='$libswanted_uselargefiles'
23962 localtime_r_proto='$localtime_r_proto'
23963 locincpth='$locincpth'
23964 loclibpth='$loclibpth'
23965 longdblkind='$longdblkind'
23966 longdblsize='$longdblsize'
23967 longlongsize='$longlongsize'
23968 longsize='$longsize'
23972 lseeksize='$lseeksize'
23973 lseektype='$lseektype'
23977 make_set_make='$make_set_make'
23978 mallocobj='$mallocobj'
23979 mallocsrc='$mallocsrc'
23980 malloctype='$malloctype'
23982 man1direxp='$man1direxp'
23985 man3direxp='$man3direxp'
23987 mips_type='$mips_type'
23988 mistrustnm='$mistrustnm'
23990 mmaptype='$mmaptype'
23991 modetype='$modetype'
23993 multiarch='$multiarch'
23995 myarchname='$myarchname'
23996 mydomain='$mydomain'
23997 myhostname='$myhostname'
24000 need_va_copy='$need_va_copy'
24001 netdb_hlen_type='$netdb_hlen_type'
24002 netdb_host_type='$netdb_host_type'
24003 netdb_name_type='$netdb_name_type'
24004 netdb_net_type='$netdb_net_type'
24007 nm_so_opt='$nm_so_opt'
24008 nonxs_ext='$nonxs_ext'
24010 nvEUformat='$nvEUformat'
24011 nvFUformat='$nvFUformat'
24012 nvGUformat='$nvGUformat'
24013 nv_overflows_integers_at='$nv_overflows_integers_at'
24014 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24015 nveformat='$nveformat'
24016 nvfformat='$nvfformat'
24017 nvgformat='$nvgformat'
24020 o_nonblock='$o_nonblock'
24022 old_pthread_create_joinable='$old_pthread_create_joinable'
24023 optimize='$optimize'
24024 orderlib='$orderlib'
24027 otherlibdirs='$otherlibdirs'
24031 patchlevel='$patchlevel'
24032 path_sep='$path_sep'
24035 perl_patchlevel='$perl_patchlevel'
24036 perl_static_inline='$perl_static_inline'
24037 perladmin='$perladmin'
24038 perllibs='$perllibs'
24039 perlpath='$perlpath'
24041 phostname='$phostname'
24047 prefixexp='$prefixexp'
24049 privlibexp='$privlibexp'
24050 procselfexe='$procselfexe'
24051 prototype='$prototype'
24053 quadkind='$quadkind'
24054 quadtype='$quadtype'
24055 randbits='$randbits'
24056 randfunc='$randfunc'
24057 random_r_proto='$random_r_proto'
24058 randseedtype='$randseedtype'
24060 rd_nodata='$rd_nodata'
24061 readdir64_r_proto='$readdir64_r_proto'
24062 readdir_r_proto='$readdir_r_proto'
24063 revision='$revision'
24069 sGMTIME_max='$sGMTIME_max'
24070 sGMTIME_min='$sGMTIME_min'
24071 sLOCALTIME_max='$sLOCALTIME_max'
24072 sLOCALTIME_min='$sLOCALTIME_min'
24073 sPRIEUldbl='$sPRIEUldbl'
24074 sPRIFUldbl='$sPRIFUldbl'
24075 sPRIGUldbl='$sPRIGUldbl'
24076 sPRIXU64='$sPRIXU64'
24078 sPRIeldbl='$sPRIeldbl'
24079 sPRIfldbl='$sPRIfldbl'
24080 sPRIgldbl='$sPRIgldbl'
24085 sSCNfldbl='$sSCNfldbl'
24086 sched_yield='$sched_yield'
24087 scriptdir='$scriptdir'
24088 scriptdirexp='$scriptdirexp'
24090 seedfunc='$seedfunc'
24091 selectminbits='$selectminbits'
24092 selecttype='$selecttype'
24093 sendmail='$sendmail'
24094 setgrent_r_proto='$setgrent_r_proto'
24095 sethostent_r_proto='$sethostent_r_proto'
24096 setlocale_r_proto='$setlocale_r_proto'
24097 setnetent_r_proto='$setnetent_r_proto'
24098 setprotoent_r_proto='$setprotoent_r_proto'
24099 setpwent_r_proto='$setpwent_r_proto'
24100 setservent_r_proto='$setservent_r_proto'
24103 sharpbang='$sharpbang'
24104 shmattype='$shmattype'
24105 shortsize='$shortsize'
24108 sig_count='$sig_count'
24109 sig_name='$sig_name'
24110 sig_name_init='$sig_name_init'
24112 sig_num_init='$sig_num_init'
24113 sig_size='$sig_size'
24114 signal_t='$signal_t'
24115 sitearch='$sitearch'
24116 sitearchexp='$sitearchexp'
24118 sitebinexp='$sitebinexp'
24119 sitehtml1dir='$sitehtml1dir'
24120 sitehtml1direxp='$sitehtml1direxp'
24121 sitehtml3dir='$sitehtml3dir'
24122 sitehtml3direxp='$sitehtml3direxp'
24124 sitelib_stem='$sitelib_stem'
24125 sitelibexp='$sitelibexp'
24126 siteman1dir='$siteman1dir'
24127 siteman1direxp='$siteman1direxp'
24128 siteman3dir='$siteman3dir'
24129 siteman3direxp='$siteman3direxp'
24130 siteprefix='$siteprefix'
24131 siteprefixexp='$siteprefixexp'
24132 sitescript='$sitescript'
24133 sitescriptexp='$sitescriptexp'
24134 sizesize='$sizesize'
24135 sizetype='$sizetype'
24139 sockethdr='$sockethdr'
24140 socketlib='$socketlib'
24141 socksizetype='$socksizetype'
24143 spackage='$spackage'
24144 spitshell='$spitshell'
24145 srand48_r_proto='$srand48_r_proto'
24146 srandom_r_proto='$srandom_r_proto'
24148 ssizetype='$ssizetype'
24149 st_ino_sign='$st_ino_sign'
24150 st_ino_size='$st_ino_size'
24151 startperl='$startperl'
24153 static_ext='$static_ext'
24155 stdio_base='$stdio_base'
24156 stdio_bufsiz='$stdio_bufsiz'
24157 stdio_cnt='$stdio_cnt'
24158 stdio_filbuf='$stdio_filbuf'
24159 stdio_ptr='$stdio_ptr'
24160 stdio_stream_array='$stdio_stream_array'
24161 strerror_r_proto='$strerror_r_proto'
24164 subversion='$subversion'
24169 targetarch='$targetarch'
24170 targetdir='$targetdir'
24171 targetenv='$targetenv'
24172 targethost='$targethost'
24173 targetmkdir='$targetmkdir'
24174 targetport='$targetport'
24175 targetsh='$targetsh'
24179 timeincl='$timeincl'
24180 timetype='$timetype'
24181 tmpnam_r_proto='$tmpnam_r_proto'
24187 ttyname_r_proto='$ttyname_r_proto'
24196 uidformat='$uidformat'
24202 uquadtype='$uquadtype'
24203 use5005threads='$use5005threads'
24204 use64bitall='$use64bitall'
24205 use64bitint='$use64bitint'
24206 usecbacktrace='$usecbacktrace'
24207 usecrosscompile='$usecrosscompile'
24208 usedevel='$usedevel'
24210 usedtrace='$usedtrace'
24211 usefaststdio='$usefaststdio'
24212 useithreads='$useithreads'
24213 usekernprocpathname='$usekernprocpathname'
24214 uselargefiles='$uselargefiles'
24215 uselongdouble='$uselongdouble'
24216 usemallocwrap='$usemallocwrap'
24217 usemorebits='$usemorebits'
24218 usemultiplicity='$usemultiplicity'
24219 usemymalloc='$usemymalloc'
24221 usensgetexecutablepath='$usensgetexecutablepath'
24222 useopcode='$useopcode'
24223 useperlio='$useperlio'
24224 useposix='$useposix'
24225 usereentrant='$usereentrant'
24226 userelocatableinc='$userelocatableinc'
24227 useshrplib='$useshrplib'
24228 usesitecustomize='$usesitecustomize'
24229 usesocks='$usesocks'
24230 usethreads='$usethreads'
24231 usevendorprefix='$usevendorprefix'
24232 useversionedarchname='$useversionedarchname'
24233 usevfork='$usevfork'
24236 uvXUformat='$uvXUformat'
24237 uvoformat='$uvoformat'
24240 uvuformat='$uvuformat'
24241 uvxformat='$uvxformat'
24243 vendorarch='$vendorarch'
24244 vendorarchexp='$vendorarchexp'
24245 vendorbin='$vendorbin'
24246 vendorbinexp='$vendorbinexp'
24247 vendorhtml1dir='$vendorhtml1dir'
24248 vendorhtml1direxp='$vendorhtml1direxp'
24249 vendorhtml3dir='$vendorhtml3dir'
24250 vendorhtml3direxp='$vendorhtml3direxp'
24251 vendorlib='$vendorlib'
24252 vendorlib_stem='$vendorlib_stem'
24253 vendorlibexp='$vendorlibexp'
24254 vendorman1dir='$vendorman1dir'
24255 vendorman1direxp='$vendorman1direxp'
24256 vendorman3dir='$vendorman3dir'
24257 vendorman3direxp='$vendorman3direxp'
24258 vendorprefix='$vendorprefix'
24259 vendorprefixexp='$vendorprefixexp'
24260 vendorscript='$vendorscript'
24261 vendorscriptexp='$vendorscriptexp'
24263 version_patchlevel_string='$version_patchlevel_string'
24264 versiononly='$versiononly'
24268 yaccflags='$yaccflags'
24273 : add special variables
24274 $test -f $src/patchlevel.h && \
24275 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24276 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24277 echo "PERL_CONFIG_SH=true" >>config.sh
24279 : propagate old symbols
24280 if $test -f UU/config.sh; then
24281 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24282 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24283 config.sh config.sh UU/oldconfig.sh |\
24284 $sort | $uniq -u >UU/oldsyms
24285 set X `$cat UU/oldsyms`
24291 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24293 echo ": Variables propagated from previous config.sh file." >>config.sh
24294 for sym in `$cat UU/oldsyms`; do
24295 echo " Propagating $hint variable "'$'"$sym..."
24296 eval 'tmp="$'"${sym}"'"'
24298 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24304 : preserve RCS keywords in files with variable substitution, grrr
24307 : Finish up by extracting the .SH files
24311 echo "Extraction done."
24321 If you'd like to make any changes to the config.sh file before I begin
24322 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24325 rp="Press return or use a shell escape to edit config.sh:"
24330 *) : in case they cannot read
24331 sh 1>&4 -c "$ans";;
24336 : if this fails, just run all the .SH files by hand
24345 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24352 Now you need to generate make dependencies by running "$make depend".
24353 You might prefer to run it in background: "$make depend > makedepend.out &"
24354 It can take a while, so you might not want to run it right now.
24359 rp="Run $make depend now?"
24363 $make depend && echo "Now you must run '$make'."
24366 echo "You must run '$make depend' then '$make'."
24369 elif test -f [Mm]akefile; then
24371 echo "Now you must run a $make."
24373 echo "Configure done."
24376 if $test -f Policy.sh; then
24379 If you compile $package on a different machine or from a different object
24380 directory, copy the Policy.sh file from this object directory to the
24381 new one before you run Configure -- this will help you with most of
24382 the policy defaults.
24386 if $test -f config.msg; then
24387 echo "Hmm. I also noted the following information while running:"
24389 $cat config.msg >&4
24392 $rm -f kit*isdone ark*isdone